title: Updating a field which the Select query loop is based on
body: <p>This is a rough example of my mysql query (note: this is inside an other loop that goes through all users):</p>
  
  <pre><code>$query = db.query('SELECT * FROM table WHERE userid = $uid AND reminded = 0');
  
  while ($row = $query-&gt;fetch()) {
    // send personalized reminder email to the user
    db.query('UPDATE table SET reminded = 1 WHERE userid = $uid');
  }
  </code></pre>
  
  <p>The field <code>reminded</code> is set to 1 for all instances for that user.</p>
  
  <p>My question is:
  Is the query/while (fetch) already loaded into memory based on the original terms (<code>reminded = 0</code>), or will the remaining while loop behave according to those updates (<code>reminded = 1</code>)?</p>
  
  <p>Let's say the user had 50 rows where <code>reminded</code> is 0, and the query selects those: Are they still existing with the value 0 in the rest of the while loop even though they were all changed to 1 during the loop?</p>