|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #74190 mysqli_num_rows return value on error
Submitted: 2017-03-01 10:29 UTC Modified: 2017-03-01 13:46 UTC
From: phpdoc at mail dot my1 dot info Assigned:
Status: Not a bug Package: MySQLi related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2017-03-01 10:29 UTC] phpdoc at mail dot my1 dot info
From manual page:
it doesnt say what gets returned on error (for comparison mysql_num_rows, according to the docs throws false).

by thorwing in a value that cant work (for example a string), it returned NULL and a warning.

since both NULL and 0 are variables that are false-y and according to both (NULL == 0) and (NULL == 0) evaluate to true there should be a warning box, noting that strict comparison using === should be appropriate, similar to

Test script:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-03-01 13:46 UTC]
-Status: Open +Status: Not a bug -Package: Documentation problem +Package: MySQLi related
 [2017-03-01 13:46 UTC]
mysqli_num_rows() always returns an int so there is no error value in that sense.

Built-in functions normally return NULL when given invalid arguments. It is documented in the functions reference:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 12:01:26 2023 UTC