Req #70372 [Opn->Csd]: Emulate mysqli_fetch_all() for libmysqlclient

From: Date: Fri, 18 Dec 2020 11:30:07 +0000
Subject: Req #70372 [Opn->Csd]: Emulate mysqli_fetch_all() for libmysqlclient
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231149@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=70372&edit=1 ID: 70372 Updated by: nikic@php.net Reported by: asphp at dsgml dot com Summary: Emulate mysqli_fetch_all() for libmysqlclient -Status: Open +Status: Closed Type: Feature/Change Request Package: MySQLi related PHP Version: Irrelevant -Assigned To: +Assigned To: nikic Block user comment: N Private report: N New Comment: Fixed by https://github.com/php/php-src/commit/037512cfce6048aae3d3900abb12310e66bc97a5. Previous Comments: ------------------------------------------------------------------------ [2016-12-22 11:20:51] 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); } ------------------------------------------------------------------------ [2015-08-27 19:38:15] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=70372&edit=1

« previous php.bugs (#231149) next »