Closed oussama415 closed 2 years ago
Use %d or %i, not %f. See sprintf docs.
On Wed, May 20, 2020 at 10:52 oussama415 notifications@github.com wrote:
Hi, Please i want to update data from a database table with a dynamic value I have an incrementing variable and I want to update this value in the database each time
I tried :
int counter ; char UPDATE_SQL[] = "UPDATE u255900507_nrsolar.modbus_mono_clients SET counter = %f WHERE id= 1"; char query2[500];
// loop() counter = 20; sprintf(query2, UPDATE_SQL, counter); Serial.println("Updating data energy."); Serial.println(query2); MySQL_Cursor *cur_mem7 = new MySQL_Cursor(&conn); cur_mem7->execute(query2); delete cur_mem7;
I have always 0 In value !!
I need your help Thanks.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/139, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYCTBUPYCWKLLQQWTXLRSPVBTANCNFSM4NGAG6BA .
Thanks so Much, it work with %d Thanks.
Closed due to inactivity. Please open a new ticket if this is still relevant.
Hi, Please i want to update data from a database table with a dynamic value I have an incrementing variable and I want to update this value in the database each time
I tried :
I have always 0 In value !!
I need your help Thanks.