I try to insert data using Node.js
and MySql
. I have database table name my_todo it has one column name uniquekey when I insert data its give following error.
{ [Error: ER_BAD_FIELD_ERROR: Unknown column '1SPwxbFzXVZFPAx' in 'field list']
code: 'ER_BAD_FIELD_ERROR',
errno: 1054,
sqlState: '42S22',
index: 0 }
Here is my code
var unik = "1SPwxbFzXVZFPAx";
con.query("insert into my_todo(uniquekey,creator_id,todo) values("+unik+",1,this is my todo)", function (err, result){
if(err){ console.log(err);}
});