Re: MySQL fetch data
| From: | Erik Price | Date: | Thu, 27 Jun 2002 13:32:47 +0000 |
| Subject: | Re: MySQL fetch data | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-104157@lists.php.net to get a copy of this message | ||
On Thursday, June 27, 2002, at 04:20 AM, Jefferson Cowart wrote:
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.You will probably always need to use a looping construct to grab your data (otherwise how will you assign each value to a variable?). But you may find it easier to use mysql_fetch_object(). http://www.php.net/manual/en/function.mysql-fetch-object.php Or maybe not. It's a matter of preference and performance (I think the object version is a bit more expensive). Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com