Closed cristina21r closed 6 years ago
This is bad SQL-Syntax, not a mysqljs error.
You have no field named "pot". A correct (long) INSERT in SQL would be:
INSERT INTO valori SET id = NULL, componenta = 'My Homework', valora = 5.6;
Check https://github.com/mysqljs/mysql#escaping-query-values on how to escape query values in mysqljs safely.
var post = {id: null, componenta: 'My Homework', valora: 5.6};
var query = connection.query(
'INSERT INTO valori SET ?',
post,
function callback (error, results, fields) {
if (error) throw error;
// Neat!
}
);
Check https://dev.mysql.com/doc/refman/5.7/en/insert.html to learn how to write INSERT-queries in (My)SQL.
Closed: no mysqljs-error
I have a table: valori, with id autoincrement, componenta text, valoare float; i try to insert from nodejs:
and i got this..but this is the value!! not a field:|:|:| i tried every possible option i know..