Socket.io:如何在socket.js中将JavaScript变量传递给mysql查询?
尝试将变量传递到mysql查询时出错。
任何帮助将不胜感激。
var number;
$query = 'INSERT INTO numbers VALUES (?)';
connection.query($query, number, function(err, result) {
if(err){
console.log("An error occurred performing the query.");
return;
}
console.log("Query successfully executed: ", rows);
});