Skip to content

Error: Wrong number of values to escape #37

@bbigras

Description

@bbigras

I got "Error: Wrong number of values to escape" while trying to run the following code. Am I missing something?

var mysql = require('db-mysql');
new mysql.Database({
  hostname: 'localhost',
  user: 'user',
  password: 'password',
  database: 'database'
}).connect(function(error) {
  if (error) {
    return console.log("CONNECTION ERROR: " + error);
  } else {

    this.query().execute("INSERT INTO test (`test`) VALUES ('?');", ['test value'], function(error, rows) {
      if (error) {
        console.log(error);
      } else {
        console.log("ok");
      }
    });
  }
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions