MySQL Forums :: Connector/Arduino :: UPDATE not working


Advanced Search

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
UPDATE not working 1894 Steve Spence 05/04/2014 04:47AM
Re: UPDATE not working 1106 Charles Bell 05/07/2014 08:39AM
Re: UPDATE not working 1086 Steve Spence 05/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.