Pyh.conf’25: a new PHP conference for the Russian-speaking community

Voting

: max(nine, seven)?
(Example: nine)

The Note You're Voting On

kurt at kovac dot ch
21 years ago
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.

<< Back to user notes page

To Top