title: How do I update multiple rows using an array in mysql using node js
body: <p>I'm trying to use UPDATE to update 3 different columns in my table(stores).  I would like to add a openingTime, closingTime, and phoneNumber...but I want them added via an storeId, which already exists in the table.  Do I need to make an individual call for each entry based on storeId.  Or is it possible for me to make a single call to the table and loop through each storeId?</p>
  
  <p>Here's what I have so far.</p>
  
  <pre><code>var arraythatcontainsEverything = [];
  
  var locations = ["randomA", "randomB", "randomC", ];
  var openingTime = ["10:00", "10:00", "10:00"];
  var closingTime = ["24:00", "24:00", "24:00"];
  var phoneNumber = ["123-4567", "123-6789", "123-9999"];
  var ids = ["210", "213", "234"];
  
  
  var q = 'UPDATE stores SET openingTime=?, closingHours=?, phoneNumber=?  WHERE StoreId=?';
  con.query(q, [array that contains everything], function(err, results){
  if(err) console.log(err); 
  if (DEBUG &gt;= 2 )console.log("finished inserting hours and phone number into database");
                  con.end();
  )};
  </code></pre>