I'm using node.js to write an HTTP server for interacting with clients and storing the data sent by them into a mysql database. I'm using node-mysql module to interact with database. Following is a snippet from my code:
mysql_conn.query('INSERT INTO systems VALUES ( ? )', [system.ClientID,
system.Application, system['System Information']], function(err, result) {
if (err) {
cb(err, res);
} else {
resData = {Status : 'Success'};
cb(null, res, resData);
}
});
The resulting query looks like this:
INSERT INTO systems VALUES ( 'ED1758FD-1ED7-4907-A4FF-BCA41830124A' )
I'm passing an array with three elements but only one show up in the query. The documentation says:
Arrays are turned into list, e.g. ['a', 'b'] turns into 'a', 'b'
Am I doing something wrong? I'm very new to javascript. Please tolerate the ignorance if any.