MySQL Forums
Forum List  »  Connector/Arduino

Re: UPDATE not working
Posted by: Charles Bell
Date: May 07, 2014 08:39AM

You must use parameter substitution and sprintf() as shown in the example code. In this case, replace the pinID with an actual value.

Hint:

const char UPDATE_DATA[] = "UPDATE db1.tbl1 SET temp = %s";

...

char query[64];
char temperature[10];
dtostrf(value_read, 1, 1, temperature);
sprintf(query, UPDATE_DATA, temperature);
my_conn.cmd_query(query);

Options: ReplyQuote


Subject
Views
Written By
Posted
3080
May 04, 2014 04:47AM
Re: UPDATE not working
1874
May 07, 2014 08:39AM
1946
May 07, 2014 09:53AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.