note 118299 added to function.oci-execute
| From: | michaelhughes at strath dot ac dot uk | Date: | Wed, 11 Nov 2015 11:38:17 +0000 |
| Subject: | note 118299 added to function.oci-execute | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-204136@lists.php.net to get a copy of this message | ||
You can pass a "false" value to oci_execute() and this returns a null value, instead of
the documented false value.
<?php
$conn = oci_connect('username', 'password, '//hostname:1521/DB');
$result = oci_execute(false);
var_dump($result);
?>
Results in "null", so performing an Identical test:
<?php
if ($results === false) {
//throw exception
}
?>
won't trap a problem, where as the Equal test (==) would:
<?php
if ($results == false) {
//throw exception
}
?>
So testing the result of a statement like oci_parse() is important!
----
Server IP: 72.52.91.14
Probable Submitter: 130.159.12.197
----
Manual Page -- http://php.net/manual/en/function.oci-execute.php
Edit -- https://master.php.net/note/edit/118299
Del: integrated -- https://master.php.net/note/delete/118299/integrated
Del: useless -- https://master.php.net/note/delete/118299/useless
Del: bad code -- https://master.php.net/note/delete/118299/bad+code
Del: spam -- https://master.php.net/note/delete/118299/spam
Del: non-english -- https://master.php.net/note/delete/118299/non-english
Del: in docs -- https://master.php.net/note/delete/118299/in+docs
Del: other reasons-- https://master.php.net/note/delete/118299
Reject -- https://master.php.net/note/reject/118299
Search -- https://master.php.net/manage/user-notes.php