Godaddy cron job sends only one email
<p>I am trying to run a cron job that executes the following PHP code:</p>

<pre><code>&lt;?php
require 'public_html/db.php';
mysql_query("SET NAMES utf8");
$aa = mysql_query("SELECT * from send where sent='0' LIMIT 20");

while($rw = mysql_fetch_array($aa)) {

$id = $rw ['id'];
$email = $rw ['email'];
$nick_sent= $rw ['nick'];
$nick_rw = $rw ['nick_pr'];

require 'public_html/mailer/PHPMailerAutoload.php';

$mail = new PHPMailer;
$mail-&gt;setFrom('info@mymail.com', 'Email');
$mail-&gt;addReplyTo('info@mymail.com', 'Email');
$mail-&gt;addAddress($email);
$mail-&gt;IsHTML(true);
$mail-&gt;Subject = 'Message';

$mail-&gt;Body = 'My message';

$mail-&gt;CharSet = "utf-8";
if ($mail-&gt;send()) {

    mysql_query("UPDATE send SET sent = '1' WHERE id='$id'");}
}   
?&gt;
</code></pre>

<p>If I access the file directly via my browser, it works perfect. However, if running it via a cron job, it will only execute the while code ONCE...meaning it only pulls the first row out of the MySQL database and sends ONE email, when it should be pulling multiple rows and sending multiple emails. Can you guys help me? Thanks.</p>