title: PHP SQL Update array
body: <p>I originally was satisfied with the following in order to update row 1 and row 2 to the same value (status=1)</p>
  
  <pre><code>if ($_POST){
      $sql ="UPDATE table SET  status = 1,
              WHERE id IN (1,2 );";
      db()-&gt;query($sql);
  
      if(db()-&gt;query($sql)){
          echo "&lt;b&gt;Good&lt;/b&gt;";
      } 
      else{
          echo "&lt;b&gt;No Good&lt;/b&gt;";
      }
  }
  </code></pre>
  
  <p>But now I want to update with different values, ie- row 1 to status 1, row 2 to status 2, and row 3 to  status 3.  </p>
  
  <p>Off the bat, I know I need to 
  1. Use an array and loop through it three times.
  2. pass in the array value into the $sql</p>
  
  <p>I figure it would be something like this but I am still learning PHP..</p>
  
  <pre><code>$array_id = array(1, 2, 3);
  $array_status = array(1, 2, 3);
  
  if ($_POST){
      $sql ="UPDATE table SET  status = $array_status
              WHERE id = $array_id;";
      db()-&gt;query($sql);
  
      if(db()-&gt;query($sql)){
          echo "&lt;b&gt;Update Successful&lt;/b&gt;";
      } 
      else{
          echo "&lt;b&gt;Update Unsuccessful&lt;/b&gt;";
      }
  }
  </code></pre>
  
  <p>How would I go about making this happen?</p>