Re: [PHP-DB] Fetch two mysql resource in while loop

2004-06-17 Thread Pablo M. Rivas
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,
 Pablomailto:[EMAIL PROTECTED]
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



[PHP-DB] Fetch two mysql resource in while loop

2004-06-16 Thread sam
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