[PHP] Re: MySQL fetch data

2002-07-01 Thread Richard Lynch

In article 00e001c21db3$7b1b66a0$0a01a8c0@jcowart , [EMAIL PROTECTED]
(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. 

Why do you think you need the data in an array?  Usually, you can just deal
with it immediately and discard it.

I think Oracle lets you snatch a whole array at once, but not MySQL.

If you screw up your SQL, you don't want to try to snatch the whole thing at
once anyway -- The potential for trashing your web/db-server by asking for,
oh, 10,000 records at once is just too high.

Better safe than sorry.

-- 
Like Music?  http://l-i-e.com/artists.htm


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




RE: [PHP] Re: MySQL fetch data

2002-07-01 Thread Cal Evans

Jeff,

Also, try php.weblogs.com ADODB if you absolutly MUST have all of your data
in an array.

I'll agree with Richard that it's not a great idea unless there is a
specific need.  While loops for displaying the contents of many records are
much better. (IMHO, etc...)

=C=

*
* Cal Evans
* Journeyman Programmer
* Techno-Mage
* http://www.calevans.com
*


-Original Message-
From: Richard Lynch [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 30, 2002 5:41 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: MySQL fetch data


In article 00e001c21db3$7b1b66a0$0a01a8c0@jcowart , [EMAIL PROTECTED]
(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.

Why do you think you need the data in an array?  Usually, you can just deal
with it immediately and discard it.

I think Oracle lets you snatch a whole array at once, but not MySQL.

If you screw up your SQL, you don't want to try to snatch the whole thing at
once anyway -- The potential for trashing your web/db-server by asking for,
oh, 10,000 records at once is just too high.

Better safe than sorry.

--
Like Music?  http://l-i-e.com/artists.htm


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



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