QUESTION: I am writing a node.js code on server which accepts multiple values from client on certain event
var table = data['table'];
var columnName = data['colName']
var columnValue = data['colValue']
var primary_id = data['pid']
var updateQuery = "UPDATE "+table+" SET "+columnName+"=? WHERE primary_id="+primary_id;
var query = conn.query(updateQuery, [columnValue] , function (err, result) {
if (err) throw err;
console.log('changed ' + result.changedRows + ' rows');
});
console.log(query.sql);
// This shows exact query which I wanted to RUN against my MySQL db and also executes successfully on my DB if I try to run this manually.
Problem:
- Query formed is correct still that query is not executing through NODE server.
NODE not showing any error thrown on anonymous call back function and not even result.
NOTE : I have tried to RUN simple select through NODE and that works perfectly [all inclusion are are made correctly for mysql module and its connection object]
It would be great if some body put some lights on further how to debug this in terms of what kind of error its getting in back-end.