how to run a query SQL in node.js mysql -
i have syntax problem in module, fail sql query. i initialize module database in file.js, responds console.log 'connected database', sends data module in database.newdata(data), when enters in runquery nothing happens, no errors or result, nothing! i in runquery if query ok , if this, think happens there error in logic of node, idea connect database , use runquery run query pass. file.js var db = require('./modules/database'); var database = new db(); database.newdata(data); database.js var mysql = require('mysql'), queries = require('./queries'), connection; var db = function(){ var db_config = { host: 'localhost', user: 'diegoug', password: 'qwertyuiop', database: 'test' }; connection = mysql.createconnection(db_config); connection.connect(function(err) { if(err) { console.log('error when connecting database:', err);