Query loop issues.
| From: | Andrew D. Luebke | Date: | Thu, 29 May 2003 16:48:04 +0000 |
| Subject: | Query loop issues. | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-28150@lists.php.net to get a copy of this message | ||
I'm having a problem with looping a query here is the skeleton of the code:
$query_result = mysql_query("SELECT * FROM Boats WHERE Serial='$serial' OR Make='$make'")
if(mysql_num_rows($query_result) > 1)
{
while($row = mysql_fetch_array($query_result, MYSQL_NUM))
{
....
}
}
else
{
....
}
This works. The code in the while loop and the code in the else statement are identical. However, if I just have the while loop without any if statement and try a query with only one resulting row the system goes into an infinite loop. I really don't see anything wrong with the logic so any help is appreciated. Thanks.
Andrew.