[PHP] Exception vs exception

2008-02-21 Thread Prabath Kumarasinghe
Hi All Recently I'm came across following code snippet regarding exceptions there I'm executing invalid query and catch the exception as follows. First Approach --- try{ $result = mysql_query('SELECT * from unknowntable'); }catch(exception $e){ echo

Re: [PHP] Exception vs exception

2008-02-21 Thread Chris
Prabath Kumarasinghe wrote: Hi All Recently I'm came across following code snippet regarding exceptions there I'm executing invalid query and catch the exception as follows. First Approach --- try{ $result = mysql_query('SELECT * from unknowntable');

RE: [PHP] Exception vs exception

2008-02-21 Thread Andrés Robinet
-Original Message- From: Prabath Kumarasinghe [mailto:[EMAIL PROTECTED] Sent: Thursday, February 21, 2008 11:19 PM To: php-general@lists.php.net Subject: [PHP] Exception vs exception Hi All Recently I'm came across following code snippet regarding exceptions there I'm executing

Re: [PHP] Exception vs exception

2008-02-21 Thread Prabath Kumarasinghe
--- Chris [EMAIL PROTECTED] wrote: Prabath Kumarasinghe wrote: Hi All Recently I'm came across following code snippet regarding exceptions there I'm executing invalid query and catch the exception as follows. First Approach --- try{

Re: [PHP] Exception vs exception

2008-02-21 Thread Paul Scott
On Thu, 2008-02-21 at 21:01 -0800, Prabath Kumarasinghe wrote: In second approach for every query I have to write throw new MySQLException(My Message). It's very time consuming isn't it? In order to *be* lazy, you have to *think* lazy... Don't go and define every single query with an

Re: [PHP] Exception vs exception

2008-02-21 Thread Chris
But it's give a many information using $e-getTrace() is this correct. If there are several mysql_query then I can put it as bunch within try block and catch exception easily. No, it doesn't give any such information. 1 :?php 2 :mysql_connect('server', 'username', 'password'); 3