title: ER_PARSE_ERROR when inserting row into MySQL database using node.js
body: <p>Trying to add a row to a mysql table using node.js, but keep getting a syntax error. New to both node/express and MySQL (downloaded the most recent versions of both a few days ago). Have compared my code with other examples and cannot figure out what is driving the error for the life of me. Code and console output below. </p>
  
  <pre><code>const express = require('express');
  const router = express.Router();
  const bcrypt = require('bcryptjs');
  const passport = require('passport');
  const mysql = require('mysql');
  
  const con = mysql.createConnection({
      host: 'localhost',
      user: 'theuser',
      password: 'thepassword',
      database: 'thedatabase'
  });
  
  con.connect(function(err) {
      if (err) throw err;
      console.log('User Connected!');
  });
  
  const date1 = new Date();
  
  const newUser = {
      first_name: first_name1, 
      last_name: last_name1, 
      email: email1, 
      password: password1,
      date: date1
  };
  
  const newUser_val = Object.values(newUser)
  console.log(newUser_val)
  const sql = "INSERT INTO webusers (first_name, last_name, email, password, register_date) VALUES ?";
  con.query(sql, [newUser_val], function (err, result, fields) {
      if(result) {
          req.flash('success_msg', 'You are now registered');
          res.redirect('../')
      } else {
          console.log(err);
      };
  });
  </code></pre>
  
  <p>And here is the relevant console output</p>
  
  <pre><code>User Connected!
  
  [
    'Pete',
    'Sample',
    'pete@gmail.com',
    '$2a$10$6ufJWiCaubg8WjE.0AHqrOFi0z3W97mSN48v.vdO7pcl20ZPRBhXW',
    2020-03-31T18:54:16.474Z
  ]
  
  code: 'ER_PARSE_ERROR',
    errno: 1064,
    sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Pete', 'Sample', 'pete@gmail.com', '$2a$10$6ufJWiCaubg8WjE.0AHqrOFi0z3W97mSN48v' at line 1",  sqlState: '42000',
    index: 0,
    sql: "INSERT INTO webusers (first_name, last_name, email, password, register_date) VALUES 'Pete', 'Sample', 'pete@gmail.com', '$2a$10$6ufJWiCaubg8WjE.0AHqrOFi0z3W97mSN48v.vdO7pcl20ZPRBhXW', '2020-03-31 14:54:16.474'"
  }
  
  </code></pre>