Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140762

Why do i get parse error when i want to make an mysql insert with nodejs

$
0
0

I have an sql insert and I recive the following error:

 code: 'ER_PARSE_ERROR',
  errno: 1064,
  sqlMessage: "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 ''CR0001'' at line 1",
  sqlState: '42000',
  index: 0,
  sql: "INSERT INTO coordonate (id_scooter,lat,longi,alt,ip,port,speed,nr_satelites,battery_lvl) VALUES 'CR0001'"

my code is:

var insert = "INSERT INTO coordonate (id_scooter,lat,longi,alt,ip,port,speed,nr_satelites,battery_lvl) VALUES  ?  ";

      con.query(insert, [array[0],array[3],array[4],array[5],rinfo.address,rinfo.port,array[6],array[2],array[1]], function (err, result) {
        if (err) throw err;

Viewing all articles
Browse latest Browse all 140762

Latest Images

Trending Articles



Latest Images