|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2010-06-18 19:25 UTC] andrey@php.net
  [2010-06-18 19:26 UTC] andrey@php.net
 
-Status:      Open
+Status:      Closed
-Assigned To:
+Assigned To: mysql
  [2010-06-18 19:26 UTC] andrey@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 01:00:01 2025 UTC | 
Description: ------------ The documentation says that mysqli_result::fetch_all - "fetches all result rows and returns the result set as an associative array, a numeric array, or both" - "Returns an array of associative or numeric arrays holding result rows" (though the return type is "mixed"). As far as I can tell, fetch_all returns NULL when there are no rows (ie, ->num_rows==0). Filed as a bug and not a documentation problem because it'd be nice to always get an array back. Test script: --------------- // Requires that mysqlnd be loaded, of course // $mysqli = new mysqli(...) $result = $mysqli->query("SELECT 1 LIMIT 0"); var_dump($result->fetch_all()); Expected result: ---------------- array(0) { } Actual result: -------------- NULL