I've recently created a PHP/MySQL while loop which fetches an array based on my parameters. From what I know about doing this, it should end when there are no more rows to grab. Mine just开发者_C百科 keeps going until I stop the page loading.
while($row = mysql_fetch_array(mysql_query("SELECT username,password,title,message FROM notifications WHERE dateset = '$date'"))){
$test = new Boxcar($row['username'],$row['password']);
$test->send($row['title'],$row['message']);
}
try like this most likely the inline query is being rerun everytime you step through the while loop
$result = mysql_query("SELECT username,password,title,message FROM notifications WHERE dateset = '$date'");
while($row = mysql_fetch_array($result)) {
$test = new Boxcar($row['username'],$row['password']);
$test->send($row['title'],$row['message']);
}
精彩评论