C function to get data from a MySQL Database and store as a variable -
i able c function insert , update cell on table, having issues able value cell , have saved variable can use compare , calculations on it. thank in advance. void mia_get_data_temperature() { mysql_res *query_results = mysql_store_result(conn); mysql_row row; //this declare row variable //int total_rows = mysql_num_rows(query_results); int num_fields = mysql_num_fields(query_results); int i; char buffer[256]; // setting buffer query string const char *query = "select temperature `temperature` mode='current_temperature'"; //snprintf() - safer thatn sprint use //checking make sure query string not large buffer & formatting query passed if (snprintf(buffer, sizeof(buffer), query) >= sizeof(buffer)) { printf("issue buffer \n"); exit (-1); } //reading mysql table if(mysql_query(conn, buffer) !=0) { fprintf(stderr, "%s\n", mysql_error(conn)); ...