Node Mysql Multiple Statements

If you happen to use npm install mysql or the native mysql connetion libary for node. You might encounter with my problem.

Something like, sql syntax error with queries containing ; (semi-colon), to join many quries to one request. I didn't know that this is forbidden by default and I need to specifically enable it with a flag.

Here is the flag:

var connection = mysql.createConnection({multipleStatements: true})  

Maybe it is default to prevent the sql injection ? may be... ?

Konpat Preechakul

Read more posts by this author.