title: while loop to update dates in DB only updates first row?
body: <p>I have no idea why this won't work. 
      <pre><code>
  function query($sql) {</p>
  
  <pre><code>     $this-&gt;result = @mysql_query($sql, $this-&gt;conn);
  
       return($this-&gt;result != false);
  
  }
  </code></pre>
  
  <p>function convert() {
          $this->db->open();
          $sql_update = "";
          $this->db->query("SELECT * FROM ACCOUNTS ");
          $str = '';
          while ($row = $this->db->fetchassoc()) {
              $jobNum = $row['JOBNUMBER'];
              $old_date = $row['INSTALLDATE'];
              $new_date = date("Y-m-d", strtotime($old_date));
              $sql_update = "UPDATE ACCOUNTS SET INSTALLDATE='$new_date' WHERE JOBNUMBER='$jobNum' ";
              //$this->db->query($sql_update) or die($this->response->throwResponseError(MSG_DATABASE_ERROR . mysql_error()));
              $str .= $jobNum . " -- " . $new_date . "<br />";
          }</p>
  
  <pre><code>    return $str;
  }
  </code></pre>
  
  <p></code></pre></p>
  
  <p>If I run it with that line commented out, it returns all the results i want. But when I uncomment the line where it actually runs the update, it updates the first record and stops the loop.  Why?</p>