Re: Fetch two mysql resource in while loop

From: Date: Thu, 17 Jun 2004 16:41:53 +0000
Subject: Re: Fetch two mysql resource in while loop
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34826@lists.php.net to get a copy of this message
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@yahoo.com.ar 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

« previous php.db (#34826) next »