Bug->Doc #74262 [Opn->Ver]: mysqli_stmt::$num_rows docs should explain more about USEd vs. STOREd resultsets

From: Date: Fri, 17 Mar 2017 19:27:04 +0000
Subject: Bug->Doc #74262 [Opn->Ver]: mysqli_stmt::$num_rows docs should explain more about USEd vs. STOREd resultsets
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14513@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74262&edit=1 ID: 74262 Updated by: requinix@php.net Reported by: darek334 at gazeta dot pl -Summary: MYSQLI_USE_RESULT with SHOW TABLES +Summary: mysqli_stmt::$num_rows docs should explain more about USEd vs. STOREd resultsets -Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem Package: MySQLi related Operating System: linux PHP Version: 7.1.3 Block user comment: N Private report: N New Comment: $num_rows is only available after all results have been fetched - MySQL does not send that information separately. STORE'd results are buffered internally so $num_rows works immediately but USE'd results are not buffered. If you want $num_rows before fetching then you need to use MYSQLI_STORE_RESULT or call mysqli_stmt::store_result(). The documentation only gives a brief mention of this, though there is a user comment that explains it in more detail. http://php.net/manual/en/mysqli-stmt.num-rows.php#71988 Previous Comments: ------------------------------------------------------------------------ [2017-03-17 13:26:08] darek334 at gazeta dot pl Description: ------------ MYSQLI_USE_RESULT with SHOW TABLES query don't show any rows in num_rows. mysqli_result->close() - don't help Test script: --------------- $query = 'SHOW TABLES LIKE "'.$table.'"',MYSQLI_USE_RESULT $query->num_rows //- shows always 0 Expected result: ---------------- 1 or higher Actual result: -------------- 0 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74262&edit=1

« previous php.doc.bugs (#14513) next »