Re: Handling exceptions

From: Date: Thu, 28 Dec 2000 10:55:53 +0000
Subject: Re: Handling exceptions
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5483@lists.php.net to get a copy of this message
If you already know that $sid and $series must have a value why don't you check its values before submit the query ? This way you'll be sure your query is correct and all errors you can get are not from your query. Have a look also on php-manual at features.error-handling.html . HTH Jayme. http://www.conex.com.br/jjeffman -----Mensagem Original----- De: Todd Cary <todd@aristesoftware.com> Para: <php-db@lists.php.net> Enviada em: quinta-feira, 28 de dezembro de 2000 01:59 Assunto: [PHP-DB] Handling exceptions > 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 > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#5483) next »