|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #70372 Emulate mysqli_fetch_all() for libmysqlclient
Submitted: 2015-08-27 19:38 UTC Modified: 2020-12-18 11:30 UTC
Avg. Score:3.7 ± 1.9
Reproduced:2 of 2 (100.0%)
Same Version:4 (200.0%)
Same OS:5 (250.0%)
From: asphp at dsgml dot com Assigned: nikic (profile)
Status: Closed Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: asphp at dsgml dot com
New email:
PHP Version: OS:


 [2015-08-27 19:38 UTC] asphp at dsgml dot com
mysqli_fetch_all() only works with mysqlnd and not libmysqlclient.

But it would be very easy to emulate by fetching results in a loop and returning the array.

Doing so would make it easier for people to write code that works on either. With mysqlnd it'll be faster, but without it will at least work.

Especially since store_result anyway retrieves all the data, it should not be any slower or more memory intensive if the data is directly referenced without being copied.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-22 11:20 UTC] spam2 at rhsoft dot net
it is really a bad joke that someone needs to write wrappers like below combined with a configuration or a function_exists() overhead which defeats the whole purpose of the function

why can't 'mysqli' handle that transparent and behave for the user idetical independent how php was built?

 /** libmysql */
   while($row = mysqli_fetch_assoc($result))
    $arr[] = $row;
 /** mysqlnd - 100% native support */
 case true: return mysqli_fetch_all($result, MYSQLI_ASSOC);
 [2020-12-18 11:30 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: nikic
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Sep 24 18:01:24 2023 UTC