note 118039 added to function.mysql-num-rows
| From: | Joebomb | Date: | Tue, 22 Sep 2015 22:51:37 +0000 |
| Subject: | note 118039 added to function.mysql-num-rows | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203838@lists.php.net to get a copy of this message | ||
In Reply to the last post: This may not always work correctly, as $object->doesExist would
contain a result, not a boolean value. A better way (using the same method) would be using a cast:
<?php
class Object {
var $doesExist = false;
[...]
function load() {
$result = mysql_query('...');
$this->doesExist = (bool) ($res = mysql_fetch_array($result))
[...]
}
}
?>
----
Server IP: 72.52.91.14
Probable Submitter: 112.199.101.51
----
Manual Page -- http://php.net/manual/en/function.mysql-num-rows.php
Edit -- https://master.php.net/note/edit/118039
Del: integrated -- https://master.php.net/note/delete/118039/integrated
Del: useless -- https://master.php.net/note/delete/118039/useless
Del: bad code -- https://master.php.net/note/delete/118039/bad+code
Del: spam -- https://master.php.net/note/delete/118039/spam
Del: non-english -- https://master.php.net/note/delete/118039/non-english
Del: in docs -- https://master.php.net/note/delete/118039/in+docs
Del: other reasons-- https://master.php.net/note/delete/118039
Reject -- https://master.php.net/note/reject/118039
Search -- https://master.php.net/manage/user-notes.php