Subject Re: [firebird-php] Throwing Exception Error
Author Jochem Maas
Uwe Oeder wrote:
> The following line of code :
>
> $this->mydbhandle =
> ibase_connect($this->myhost,$this->myusername,$this->mypassword) or
> (throw new Exception(ibase_errmsg())) ;

is there any one else out there that thinks the 'or die()' error checking
method sucks? or maybe someone with real insight could explain when such a
construction is ok/valid/useful/etc...

...anyway something along the lines of:

$this->mydbhandle = ibase_connect($this->myhost,$this->myusername,$this->mypassword);
if (!is_resource($this->mydbhandle)) {
throw new Exception(ibase_errmsg());
}

>
> returns me the following error :
>
> Parse error: syntax error, unexpected T_THROW in
> Z:\version2\files\library\_debug_tmp.php on line 99
>
> how can I throw the exception on something like an error when connecting
> to the database.
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>