|  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: -
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:
Status: Open Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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);
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Oct 24 21:01:24 2020 UTC