Re: 2D arrays
| From: | Ignacio Vazquez-Abrams | Date: | Fri, 08 Dec 2000 18:41:55 +0000 |
| Subject: | Re: 2D arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-29390@lists.php.net to get a copy of this message | ||
On Fri, 8 Dec 2000, Thomas Holton wrote:
> Well, I have 3 different methods of display this data from the database as
> per the users preferences. i used to just have fetchrow array commands in
> my previous perl script in each of then. but here, i thought i could
> gather all of the data in to a single 2d array and pass this to 3
> different functions, thus only gathering the data once.. you see what i
> mean? I am thinking i will have to pass the result from the database query
> to all three funcs and then extract it, huh?
> -thanks
>
Try:
$table=Array();
while($row=mysql_fetch_array($result))
$table[]=$row;
Then just pass $table around.
--
Ignacio Vazquez-Abrams <ignacio@openservices.net>