#46858 [Opn->Fbk]: Incorrect isset result on MySQLi_Result properties
| From: | jani@php.net | Date: | Thu, 18 Dec 2008 15:28:29 +0000 |
| Subject: | #46858 [Opn->Fbk]: Incorrect isset result on MySQLi_Result properties | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-132155@lists.php.net to get a copy of this message | ||
ID: 46858
Updated by: jani@php.net
Reported By: eric at livejorunal dot dk
-Status: Open
+Status: Feedback
Bug Type: MySQLi related
Operating System: Linux
PHP Version: 5.2.8
New Comment:
Why do you test if that property exists anyway? It's always there, you
don't need to test for that. :)
Previous Comments:
------------------------------------------------------------------------
[2008-12-13 16:46:02] eric at livejorunal dot dk
Description:
------------
isset returns false when applied to a MySQLi_result object that does
indeed exist.
Reproduce code:
---------------
<?php
$db = new mysqli('localhost', 'test', 'test', 'test');
$result = $db->query('SELECT * FROM test;'); //contains 1 row
echo $result->num_rows;
if (isset($result->num_rows))
echo 'defined';
else
echo 'undefined';
?>
Expected result:
----------------
1defined
Actual result:
--------------
1undefined
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=46858&edit=1