Exceptions problems
Posted: Fri Sep 08, 2006 9:06 am
Ok, so I have read the PHP manual and tried out their examples, but I cant for the life of me just make it come out with an error such as:
It always comes out as:
This is the code I am using:
DBError class
Connection.class.html
Does anyone know why it is doing this?
Thanks,
someberry.
Code: Select all
DBError: You do not seem to have database permission.Code: Select all
Fatal error: Uncaught DBError: You do not seem to have database permission. thrown in D:\localhost\htdocs\classes\Connection.class.html on line 45DBError class
Code: Select all
class DBError extends Exception
{
function __construct($message)
{
parent::__construct($message, 0);
}
public function __toString()
{
return __CLASS__ . ': ' . $this->message;
}
}Code: Select all
$this -> connection = @mysql_connect ('localhost', 'user', 'password', true);
if(!$this -> connection)
{
throw new DBError('You do not seem to have database permission.');
}Thanks,
someberry.