Re: Fetch two mysql resource in while loop

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

 



Hello sam,

      Did you try:
         while($row1=mysql_fetch_row($result1) AND $row2=mysql_fetch_row($result2))  ?

         or this:
         while(($row1=mysql_fetch_row($result1)) && ($row2=mysql_fetch_row($result2)))  ?
         
         good luck!

   P.S. These two actually work... i'm trying to figure out why this
   is so... Perhaps operator precedence?... don't know for sure.

-- 
Best regards,
 Pablo                            mailto:pmrivas01@xxxxxxxxxxxx
Thursday, June 17, 2004, 12:26:29 AM, you wrote:

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