Fetch two mysql resource in while loop

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

 



Hi all:
i worte a piece of code like this
$result1 = mysql_query(query1);
$result2 = mysql_query(query2);
while($row1=mysql_fetch_row($result1) && $row2=mysql_fetch_row($result2)){
............}
only $row2 is initazlied. row1 is always empty.
if i change it like this
while($row1=mysql_fetch_row($result1)){
$row2=mysql_fetch_row($result2)
.......}
there will be no problem and both $row1 and $row2 contain values.
can anyone tell me why? is it i worte something wrong?
sam


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