title: Need help to write mysql update query in node.js with callback
body: <p>I am a beginner for Node.js. Please help to fix this.</p>
  
  <p>Without giving <strong><em>WHERE</em></strong> clause update is working fine. Below is the script without "WHERE" clause:</p>
  
  <pre><code>var post  = {name: 'Amit', mobile:'123456'};
  var query = connection.query('UPDATE contacts SET ? ', post , function(err, result) {});
  console.log(query.sql);
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/M8Gb2.png" alt="enter image description here"></p>
  
  <p>Now I added 'WHERE' clause..getting error:</p>
  
  <pre><code>var post  = {name: 'Amit', mobile:'123456'};
  var condition = {id:4};
  var query = connection.query('UPDATE contacts SET ? ',post,' WHERE '+ condition , function(err, result) {});
  console.log(query.sql);
  </code></pre>
  
  <p>Output:</p>
  
  <p><img src="https://i.stack.imgur.com/cG3ub.png" alt="enter image description here"> </p>