note 42128 modified in function.ociparse by danbrown
| From: | danbrown@php.net | Date: | Wed, 25 Feb 2009 14:09:29 +0000 |
| Subject: | note 42128 modified in function.ociparse by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151109@lists.php.net to get a copy of this message | ||
For those that are having trouble with error checking, i have noticed on a lot of sites that people
are trying to check the statement handle for error messages with OCIParse. Since the statement
handle ($sth) is not created yet, you need to check the database handle ($dbh) for any errors with
OCIParse. For example:
instead of:
<?php
$stmt = OCIParse($conn, $query);
if (!$stmt) {
$oerr = OCIError($stmt);
echo "Fetch Code 1:".$oerr["message"];
exit;
}
?>
use:
<?php
$stmt = OCIParse($conn, $query);
if (!$stmt) {
$oerr = OCIError($conn);
echo "Fetch Code 1:".$oerr["message"];
exit;
}
?>
Hope this helps someone.
--was--
For those that are having trouble with error checking, i have noticed on a lot of sites that people
are trying to check the statement handle for error messages with OCIParse. Since the statement
handle ($sth) is not created yet, you need to check the database handle ($dbh) for any errors with
OCIParse. For example:
instead of:
$stmt = OCIParse($conn, $query);
if (!$stmt) {
$oerr = OCIError($stmt);
echo "Fetch Code 1:".$oerr["message"];
exit;
}
use:
$stmt = OCIParse($conn, $query);
if (!$stmt) {
$oerr = OCIError($conn);
echo "Fetch Code 1:".$oerr["message"];
exit;
}
Hope this helps someone.
http://php.net/manual/en/function.ociparse.php