Skip to content Skip to sidebar Skip to footer

Insert Statement With Where Clause Doesnt Run On Nodejs Mysql

Code: function setvalue(val) { idoutput=val; base62val=Base.encode(idoutput); var baseinsert = {ShortUrlCode:base62val}; console.log(idoutput);

Solution 1:

'INSERT INTO URLTABLE set ?  where ID = ?'

You forgot to mention column names that you want to "SET".

 'INSERT INTO URLTABLE SET column_name = ? (, column_name2 = ?,...) WHERE ID = ?'

is the correct syntax

EDIT:

Note that it is always better to "standardize" your SQL queries, in which case you better use the standard SQL syntax below for an INSERT (instead of using your specific MySQL syntax):

INSERT INTO URLTABLE (a, b, c) VALUES (?,?,?)


Post a Comment for "Insert Statement With Where Clause Doesnt Run On Nodejs Mysql"