title: Using foreach to update fields in a mysql database based on another query
body: <p>I have to do a first query which is <code>SELECT * from table WHERE NOT column=0</code>, and use the results from that to do a foreach loop something like below.</p>
  
  <pre><code>foreach($results as $result) { 
  $nox = $result[field_x]; 
  //Use nox for whatever; 
  //Then update some fields in SQL; }
  </code></pre>
  
  <p>And keep doing that until all the items in the first query are done.</p>
  
  <p>What would the syntax be?</p>