Andrew.
At 09:51 AM 5/29/2003, you wrote:
shouldn't you be fetching a row and not an array? while($row = mysql_fetch_row($query_result, MYSQL_NUM))
rick
----- Original Message ----- From: "Andrew D. Luebke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, May 29, 2003 11:48 AM Subject: [PHP-DB] Query loop issues.
> 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. > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php