Hi everyone so I try to use the IN sql command in sql node js plugin. I try a lot of syntax but all doesn't work. Can you help me ?
Thanks
Code :
var arr = log1.map( function(el) { return el.token; });
con.query( 'SELECT Nomfamille,prenomutilisateur FROM utilisateurs WHERE idpublic IN = ' + arr.join() + '', function (error, results, fields) {
another syntax :
con.query( 'SELECT Nomfamille,prenomutilisateur FROM utilisateurs WHERE idpublic IN = (' + arr.join() + ')', function (error, results, fields) {
and :
con.query( 'SELECT Nomfamille,prenomutilisateur FROM utilisateurs WHERE idpublic IN = ? ', [arr.join()] function (error, results, fields) {
the error :
Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '= 23246,18200' at line 1