title: PHP while loop iterates only once
body: <p>Quick Question; </p>
  
  <p><code>$sql = mysql_query("SELECT * FROM cronjobs WHERE status = 0 ");</code></p>
  
  <pre><code>while($cronjob = mysql_fetch_array($sql)){
      if($cronjob['suid'] != $cronjob['cuid']){
          //echo 'not equal&lt;br&gt;';
          $set = 0;
          $sid = $cronjob['sid'];
          $suid = $cronjob['suid'];
          $cuid = $cronjob['cuid'];
          $set = notify($sid, $suid, $cuid);
          if($set==1){
              //echo 'notified&lt;br&gt;';
              $sql = "UPDATE cronjobs SET status = '1' WHERE id='".$cronjob['id']."'";
              if(mysql_query($sql)){
                 echo '1&lt;br&gt;';
                $set = 0;
            }
          }
        }
     }
  }
  </code></pre>
  
  <p><code>notify()</code> will <code>return 1</code> (numeric) </p>
  
  <p>The problem is only one iteration of the while loop is executed even though there are more records. I don't know what's wrong here. Help me out pls. </p>