note 100544 added to mysqli-result.num-rows

From: Date: Fri, 22 Oct 2010 13:12:22 +0000
Subject: note 100544 added to mysqli-result.num-rows
Groups: php.notes 
Request: Send a blank email to php-notes+get-173372@lists.php.net to get a copy of this message
I have tried empty($result->num_rows) and noticed, that this does not work as I expected. When $result->num_rows == 1 results in true empty($result->num_rows) results also in true. Notice, that num_rows is inaccessible member, so use empty($result->num_rows) with care. this is strange to me, but $i = $result->num_rows; // $i == 1 var_dump(empty($i)); // true ---- Server IP: 78.41.104.8 Probable Submitter: 89.208.18.62 ---- Manual Page -- http://www.php.net/manual/en/mysqli-result.num-rows.php Edit -- https://master.php.net/note/edit/100544 Del: integrated -- https://master.php.net/note/delete/100544/integrated Del: useless -- https://master.php.net/note/delete/100544/useless Del: bad code -- https://master.php.net/note/delete/100544/bad+code Del: spam -- https://master.php.net/note/delete/100544/spam Del: non-english -- https://master.php.net/note/delete/100544/non-english Del: in docs -- https://master.php.net/note/delete/100544/in+docs Del: other reasons-- https://master.php.net/note/delete/100544 Reject -- https://master.php.net/note/reject/100544 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#173372) next »