title: { Error: ER_PARSE_ERROR: You have an error in your SQL syntax
body: <blockquote>
    <p>{ Error: ER_PARSE_ERROR: 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 'undefined' at line 1</p>
  </blockquote>
  
  <p>I've tried adding back ticks in the table columns but that didn't work. </p>
  
  <pre><code>function quantityCheck(ID, itemsPurchased){
      connection.query('Select * FROM `products` WHERE `item_id` ' + ID, function(err, res){
          if (err){console.log(err)};
          if(itemsPurchased &lt;= res[0].stock_quantity){
              var total = res[0].price * itemsPurchased;
              console.log('Your items are available for final purchase.')
              console.log ('Total today for ' + itemsPurchased + ' ' + res[0].product_name + ' is ' + total);
  
              connection.query('UPDATE products SET stock_quantity = stock_quantity -' + itemsPurchased + 'WHERE item_id = ' + ID);
          } else {
              console.log ('Your purchase could not be processed. We have limited quantities of ' + res[0].product_name);
          }
          display();
      })
  </code></pre>
  
  <p>I'm wanting to show the quantityCheck(); code after the connection.query method.</p>