Error: ER_PARSE_ERROR, error in your SQL syntax

I don't know what is happening, I've tried everything, the code is simple and it gives me the error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'humidity_AF' at line 1"

I have two topics, temperature_AF works, but when i try to send the data from the topic of humidity_AF it doesn't work.

var humedad = msg.payload;

msg.payload = "INSERT INTO `humedad`(`Humedad`) VALUES (" + humedad + ")";

return msg;

The QUERY needs to be in msg topic not payload.

you got it correct for termpertura!

Always read the built-in help for the node (help is in the side bar on the right)

Thanks, im stupid

1 Like

No worries, it happens.

If it fixes your issue, please mark the post as soved.

Ta.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.