php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #19777 We need mysql_fetch_all($mysql_result,[TYPE])
Submitted: 2002-10-06 05:05 UTC Modified: 2002-10-06 14:14 UTC
Votes:5
Avg. Score:4.4 ± 0.8
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:2 (40.0%)
From: bav at graphit dot ru Assigned:
Status: Wont fix Package: Feature/Change Request
PHP Version: 4CVS-2002-10-06 OS: All
Private report: No CVE-ID: None
 [2002-10-06 05:05 UTC] bav at graphit dot ru
So, please, we need an analog of pg_fetch_all for mysql...
for speed 
Assume TYPE of fetching is MYSQL_ASSOC etc...

We want to avoid manual fetching like following:
$rt = mysql_query("select from...");
while($cur = mysql_fetch_assoc($rt))
 $result[]=$cur;

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-06 14:14 UTC] georg@php.net
Looks like the only reason is, that you don't want to write an addidtional line to fetch the rows in a loop.

Do you see any other benefits?!

I only see disadvantages... if you need such functionality, why don't write a php-function for?! Personally I don't know any Database, which supports such kind of functionality; who ever introduced such a function in pgsql must be drunk :)
 [2002-10-10 09:03 UTC] bav at graphit dot ru
Sorry, but I see an advantage. Only one - speed.

Yes, I know, I can write php function for fetching :)
We are not idiots :)
 [2010-12-19 06:49 UTC] hafizanil at hotmail dot com
Currently on 2010.Everything data fetch in json.If the mysql result can directly push to json data.It much speedier then looping the data and json_encode it again.
 [2011-09-30 20:29 UTC] risto78 at gmail dot com
the function overhead alone of calling this function in a loop several thousand 
times should be enough to make a mysql_fetch_all function
 [2011-09-30 20:36 UTC] risto78 at gmail dot com
see http://php.net/manual/en/mysqli-result.fetch-all.php
 [2012-01-27 12:07 UTC] vitor dot luis98 at gmail dot com
We need urgent mysql_fetch_all, I think it past time to have it. Equals 
pg_fetch_all. Please o/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 18:01:31 2024 UTC