Friday, 26 January 2018

Completely stuck

I've been trying to insert some database records but keep getting,Parser.js:80 throw err; // Rethrow non-MySQL errors ^ 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 ''2018-01-26T12:37:21.000Z', 'paymium', 8686.915, 8502.59, 8871.24' at line 1 What is wrong with the following insert?var values = [tick['datetime'], ex, fv, tick['b'], tick['a']]; var sql = "INSERT INTO table (data,ex,fv,b,a) VALUES ?"; con.query(sql, [values], function (err, result, fields) { if (err) throw err; console.log (tick['datetime'],'\t', ex,'\t', fv,'\t', tick['b'],'\t' ,tick['a']); });

Submitted January 26, 2018 at 12:44PM by normanu82

No comments:

Post a Comment