Subject | Re: [firebird-php] Throwing Exception Error |
---|---|
Author | Jochem Maas |
Post date | 2005-06-13T11:41:12Z |
Uwe Oeder wrote:
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());
}
> The following line of code :is there any one else out there that thinks the 'or die()' error checking
>
> $this->mydbhandle =
> ibase_connect($this->myhost,$this->myusername,$this->mypassword) or
> (throw new Exception(ibase_errmsg())) ;
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
>
>
>
>
>
>