Re: Query loop issues.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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:  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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux