|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74262 mysqli_stmt::$num_rows docs should explain more about USEd vs. STOREd resultsets
Submitted: 2017-03-17 13:26 UTC Modified: 2017-03-17 19:27 UTC
From: darek334 at gazeta dot pl Assigned:
Status: Verified Package: MySQLi related
PHP Version: 7.1.3 OS: linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
45 + 34 = ?
Subscribe to this entry?

 [2017-03-17 13:26 UTC] darek334 at gazeta dot pl
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:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-17 13:53 UTC]
-Package: *General Issues +Package: MySQLi related
 [2017-03-17 19:27 UTC]
-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
 [2017-03-17 19:27 UTC]
$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.
 [2017-03-17 20:03 UTC] 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 20:08 UTC] darek334 at gazeta dot pl
Especially more info here :
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Tue Dec 01 15:01:34 2020 UTC