// ...
That's from memory, so there may be a few errors.

Seems there was. Try this:

class DBException extends Exception {}

try {
    $connection = mysql_connect(...);

    if (!$connection) {
        throw new DBException('Failed to connect to database');
    }

// Database exception handling code
} catch (DBException $e) {
    // ...

// Generic Exception handling code (The Exception class is
// built in to PHP)
} catch (Exception $e) {
    // ...
}

--
Richard Heyes
http://www.websupportsolutions.co.uk

Knowledge Base and Helpdesk software for £299 hosted for you -
no installation, no maintenance, new features automatic and free

             ** New Helpdesk demo now available **

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to