php.net |  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: -
Votes:3
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: asphp at dsgml dot com
New email:
PHP Version: OS:

 

 [2015-08-27 19:38 UTC] asphp at dsgml dot com
Description:
------------
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.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

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?

switch($this->mysqlnd)
{
 /** libmysql */
 default:
   while($row = mysqli_fetch_assoc($result))
   {
    $arr[] = $row;
   }
   break;
 /** mysqlnd - 100% native support */
 case true: return mysqli_fetch_all($result, MYSQLI_ASSOC);
}
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Nov 19 03:01:36 2019 UTC