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

From: Date: Thu, 05 Aug 2021 11:25:01 +0000
Subject: Doc #74262 [Ver->Csd]: 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-19040@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: cmb@php.net Reported by: darek334 at gazeta dot pl Summary: mysqli_stmt::$num_rows docs should explain more about USEd vs. STOREd resultsets -Status: Verified +Status: Closed Type: Documentation Problem Package: MySQLi related Operating System: linux PHP Version: 7.1.3 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This should be fixed by <https://github.com/php/doc-en/commit/e994a8d5be2529d508f6ee45fb53ca60502a7c9e>. Previous Comments: ------------------------------------------------------------------------ [2017-03-17 20:08:03] darek334 at gazeta dot pl Especially more info here : http://php.net/manual/en/mysqli.query.php ------------------------------------------------------------------------ [2017-03-17 20:03:11] darek334 at gazeta dot pl Like as I see, There is some others method internal storing of data, one available for code and other hide. Sense of manual is different. ------------------------------------------------------------------------ [2017-03-17 19:27:02] requinix@php.net $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 ------------------------------------------------------------------------ [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 (#19040) next »