59
rated 0 times
[
65]
[
6]
/ answers: 1 / hits: 29915
/ 6 Years ago, tue, march 20, 2018, 12:00:00
I'm trying to insert values
using mysql in nodejs. I had written the following code and installed MySQL support via npm,But canot to INSERT INTO the table due to this problem.
My code;
var mysql = require('mysql');
var values=randomValueHex(8);
var sql = INSERT INTO `activationkeys`(`activationKey`, `productId`)
VALUES ( values ,'3');
con.query(sql, function (err, result) {
if (err) throw err;
console.log(1 record inserted);
});
My Error on terminal:
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''3')'
How can i solve this problem?
More From » mysql