Code:
function setvalue(val) {
idoutput=val;
base62val=Base.encode(idoutput);
var baseinsert = {ShortUrlCode:base62val};
console.log(idoutput);
console.log(base62val);
con.query('INSERT INTO URLTABLE set ? where ID = ?',[baseinsert,idoutput],function(err){
if(err) console.log(err);
})
console.log("short inserted");
con.end();
}
Error I am receiving:
{ [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 'where ID = 38' at line 1]
code: 'ER_PARSE_ERROR',
errno: 1064,
sqlState: '42000',
index: 0 }
See Question&Answers more detail:os