Handling exceptions
| From: | Todd Cary | Date: | Thu, 28 Dec 2000 03:59:42 +0000 |
| Subject: | Handling exceptions | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-5479@lists.php.net to get a copy of this message | ||
I have a function that updates a table. Though an exception should not
occur, I am not sure how to handle an exception if one should occur. If
the query is not successful, $sthdl will be "0", but if the query itself
is incorrect (e.g. $sid is blank), and exception would be generated.
Todd
function db_add_series_session($dbh, $sid, $series) {
$stmnt = "UPDATE SESSIONS SET SES_COURSE='" . $series . "' WHERE
SES_SESSION_ID=" . $sid;
$sthdl = ibase_query($stmnt,$dbh);
ibase_commit();
return $sthdl;
};
--
Todd Cary
Ariste Software
todd@aristesoftware.com