title: Updating multiple MYSQL rows via PHP
body: <p>I am fairly new to PHP, I know the basics but not sure how to update multiple rows at once in PHP? form is similar to this:</p>
  
  <pre><code>&lt;form action="sortorder.php" id="sortorder"&gt;
  
  &lt;input style='width:20px;' type='text' name='photo' value='1'&gt;
  &lt;input style='width:20px;' type='text' name='sortorder' value='1'&gt;
  
  &lt;input style='width:20px;' type='text' name='photo' value='2'&gt;
  &lt;input style='width:20px;' type='text' name='sortorder' value='2'&gt;
  
  &lt;input style='width:20px;' type='text' name='photo' value='3'&gt;       
  &lt;input style='width:20px;' type='text' name='sortorder' value='3'&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>I need to apply similar code to the following to each</p>
  
  <pre><code>UPDATE photos SET sortorder = &lt;input&gt; WHERE id = '1';
  UPDATE photos SET sortorder = &lt;input&gt; WHERE id = '2';      
  </code></pre>
  
  <p>I just have no idea how to take multiple bits of dynamic data and update them all. Can someone point me in the right direction? I realise I need to put them into an array, but I just don't know how.</p>
  
  <p>Thank you in advance.</p>