database = new MySQL(this, "localhost", database , user , pass); }
void draw() { sensorValue = (5.0 * arduino.analogRead(sensorTemp) * 100.0) / 1024.0; // read the value and make the conversion
println(sensorValue);
if ( database.connect() ) { database.execute("INSERT INTO `data-arduino`.`temperature` (`TEMPERATURE`) VALUES ('sensorValue');"); } else { println("Error in the connection :-( "); }
delay(300000); // Wait 5 minutes }
The problem is that with this code, I send the name of the variable (sensorValue) to the MySQL database, but what I want to send to the MySQL database is the value of the variable, not the name.
What do I have to do to send the value of the variable and not the name of it to a MySQL database?