RE: [PHP] MySQL fetch data
| From: | John Holmes | Date: | Thu, 27 Jun 2002 08:46:00 +0000 |
| Subject: | RE: [PHP] MySQL fetch data | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104117@lists.php.net to get a copy of this message | ||
> Is there any way to return all the rows returned by a mysql query with
> one command. Currently I have to run through a for or while loop the
> same number of times as there are rows and take that row and copy it
to
> an array. I end up with an array of arrays but it seems like it would
be
> a common enough problem that the function would already exist.
No. Write your own wrapper function for MySQL_query() that does it for
you...put it in a class....use it. Some abstraction layers that are out
there may provide functions that do this for you, though. I generally
avoid doing such things if I have to, that way I'm not wasting a bunch
of memory in PHP by creating these huge arrays...
---John Holmes...