Edit report at http://bugs.php.net/bug.php?id=52302&edit=1
ID: 52302 Updated by: johan...@php.net Reported by: brianlm...@php.net Summary: mysqli_fetch_all does not work with MYSQLI_USE_RESULT Status: Assigned Type: Bug Package: MySQLi related Operating System: Linux PHP Version: 5.3.2 Assigned To: mysql Block user comment: N New Comment: The key point here is that the stored buffer can directly be used for fetch_all. The fetch_all does nothing but increasing the ref counts on the buffered values and adding them to an array. doing this with USE_RESULT would do an implicit STORE_RESULT. Marking this a Feature request. Previous Comments: ------------------------------------------------------------------------ [2010-07-16 17:42:59] brianlm...@php.net No, it makes perfect sense. In fact, it should be the preferred way to use fetch_all. Why store the data only to dump it into a PHP array on the next line? That is a very inefficient use of memory and plain careless development. Or do you mean to say that fetch_all is fundamentally broken and will only work with STORE_RESULT? ------------------------------------------------------------------------ [2010-07-13 10:36:22] and...@php.net Makes no sense to use USE_RESULT and buffer the result. Use STORE_RESULT, it is more effective for fetch_all(). Artifically limited. ------------------------------------------------------------------------ [2010-07-12 18:16:35] brad at njoe dot com Confirmed on Windows build as well using: PHP 5.3.2 (cli) (built: Mar 3 2010 19:40:13). Even SELECT'ing a static string (e.g. SELECT 'This is a test.') exhibits this behavior. ------------------------------------------------------------------------ [2010-07-10 10:39:32] brianlm...@php.net Description: ------------ When using MYSQLI_USE_RESULT as the second parameter to mysqli_query, fetch_all returns null. Test script: --------------- <?php $m = new MySQLi("", "root", "", "information_schema"); $sql = "show tables"; $res = $m->query($sql, MYSQLI_USE_RESULT); $rows = $res->fetch_all(); var_dump($rows); ?> Expected result: ---------------- An array of the table data. Actual result: -------------- NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=52302&edit=1