Re: Query loop issues.

From: Date: Thu, 29 May 2003 16:55:05 +0000
Subject: Re: Query loop issues.
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-28151@lists.php.net to get a copy of this message
From the docs it appears that they are functionally equivalent, with mysql_fetch_array having a few more options for indexing the array. 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" <andrew@copeandmcphetres.com> To: <php-db@lists.php.net> 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


« previous php.db (#28151) next »