title: Updating database with multiple checkbox values received from the loop?
body: <p>Basically I am trying to update my database with multiple values. Input fields are in a loop, so I need to update multiple checkboxes and textboxes at the same time. </p>
  
  <pre><code>$cityID = $_POST["cityID"];
  $cityStatus = $_POST["cityStatus"];
  $cityOrder = $_POST["cityOrder"];  
  
  $updateCities = $db-&gt;execute("UPDATE cities SET city_status=?, city_order=? WHERE city_ID=$cityID", array($city_status, $cityOrder));
  
  foreach($cities as $row) :
  ?&gt;
  
  &lt;input type="checkbox" name="cityStatus[]" value="1"&gt;
  &lt;input type="text" name="cityOrder[]" value="&lt;?php echo $row-&gt;city_order ?&gt;"&gt;
  &lt;input type="hidden" name="cityID" value="&lt;?php echo $row-&gt;city_ID; ?&gt;"&gt;
  </code></pre>