|  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
35 - 20 = ?
Subscribe to this entry?

 [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: Mon Sep 25 20:01:25 2023 UTC