Hi,
I'm using an arduino for collecting some data and I want to send it to my MySql database.
I first split the incoming data: 56'51'34'67
and then i put it in different variables, but when i use that variable in my query it doesnt work!
can somebody please tell me what i am doing wrong?
code:
var outputMsgs = [];
var words = msg.payload.split("'");
for (var w in words) {
outputMsgs.push({payload:words[w]});
}
var msg1 = outputMsgs[0];
var msg2 = outputMsgs[1];
var msg3 = outputMsgs[2];
var msg4 = outputMsgs[3];
var newMsg = { payload: msg1 };
newMsg.topic="insert into Sensor_data (naam,payload) values ('0',"+newMsg.payload+")";
return newMsg;
thanks in advance
tom