while($tmp=mysql_fetch_array($res)) { // now $tmp is now an array (as the function name suggests)
   $rows[]=$tmp; // by assigning to $rows[], we make $rows an array, adding array $tmp as the last element
}

and this makes it multidimensional



Beauford.2002 wrote:

Great. now can you explain why this works. I'm confused at how PHP knows
this is a multidimensional array. I was trying something like $tmp[][]=???.

TIA

----- Original Message -----
From: "Marek Kilimajer" <[EMAIL PROTECTED]>
Cc: "Beauford.2002" <[EMAIL PROTECTED]>; "PHP General"
<[EMAIL PROTECTED]>
Sent: Friday, December 27, 2002 8:45 AM
Subject: Re: [PHP] Nested Arrays



Sorry, now I reminded myself this would cause a false element at the end
of $rows, use this:
while($tmp=mysql_fetch_array($res)) {
$rows[]=$tmp;
}

Marek Kilimajer wrote:


Simple:

while($rows[]=mysql_fetch_array($res)) {}

($res is a mysql result resource)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to