>>
>> if (!$ret) {
>> // An Exception error is thrown
>> throw new Exception;
>> } elseif (!is_resource($ret)) {
>> return TRUE;
>> } else {
>> $statment = new DB_MysqlStatement($this->dbh, $query);
>> return $statement;
>> }
>>
>> Fatal error: Uncaught exception 'Exception' in
>
> Uncaught exceptions happen whenever you THROW an exception that isn't
> caught. This allows you to do certain things when exceptions happen and
> try to recover from the error. So, it should work when you try this:
>
>
> try {
> $dbh = new DB_Mysql("user","passwd","localhost","test");
> $query = 'INSERT into aeMail set test=\''.$_POST["test"].'\'';
> $dbh->execute($query);
> }
> catch (Exception $e) {
> // This just prints, but you could do other things like ignoring
> // the error or trying to reconnect, etc.
> echo $e->getMessage();
> print_r( $e->getTrace() );
> }
>
Nice, that makes it easier on the eyes to read.
--Matthew Sims
--<http://killermookie.org>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php