Here is the question, how do you use msg.payload to provided values for INSERT SQL statement?
I am using a
node-red-node-mysql node. If I create a complete SQL INSERT statement, put it in msg.topic it works. For example:
INSERT table(`Me`, `You`) VALUES (`Good`, `Bad`);
But if I set msg.topic to:
You) VALUES (?,?);
And msg.payload to:
The INSERT fails. Parse error, that the SQL query has a syntax issue.
The issue is that the node documentation says this possible, and I see several google examples saying this is possible, but I can't get it to work.
I also tried to do
INSERT table(`Me`, `You`) VALUES (msg.payload, msg.payload);
But I am sure something is not right with the above. I get an odd message about msg.payload is not understood. Any suggestions welcome, thanks.