> I'm having a problem with looping a query here is the skeleton of the
> $query_result = mysql_query("SELECT * FROM Boats WHERE Serial='$serial' OR
> if(mysql_num_rows($query_result) > 1)
> while($row = mysql_fetch_array($query_result, MYSQL_NUM))
If the code is identical here, you're never fetching an row/array from the
result set... I don't know why it would cause an "infinite loop" but it's
not going to display anything from the database unless you put a
mysql_fetch_array() for the case that only one row is returned.
> 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.
Why do you need to act differently if only one row is returned? If the code
is identical, why can't you just call while(...) and only have it loop once?
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php