RE: [PHP] Stricter Error Checking?

2009-09-23 Thread Samrat Kar
; } $ts = time(); $errno = $this->query_err_no; $errmsg = addslashes($this->query_err_msg); $state = $this->sqlstate; $sql = "INSERT INTO pi_global.tblerrorlog VALUES('','$ts','$query','$errno','

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jim Lucas
Tim Legg wrote: > Hello, > > I just spent way, way to much time trying to debug code due to a misnamed > element. Here is a simplified example of the problem I dealt with. > > > $test = "SELECT * FROM `Materials` WHERE `Part_Number` = '125664'"; > $result = mysql_query($test,$handl

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
Bob McConnell wrote: > From: Tommy Pham >>> From: Tim Legg >>> >>> I just spent way, way to much time trying to debug code due to a > misnamed >>> element. Here is a simplified example of the problem I dealt with. >>> >>> >>> $test = "SELECT * FROM `Materials` WHERE `Part_Number` = > '125664'

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Shawn McKenzie
>> I think the problem is that he didn't check that the key he used >> actually existed before using the value it pointed to. So he got an >> empty string for $row['Number']; because the key should have been >> 'Part_Number'. I don't know that even E_STRICT would catch that one. >> >> Bob McConnell

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Tommy Pham
- Original Message > From: Bob McConnell > To: Tommy Pham ; php-general@lists.php.net > Sent: Wednesday, September 23, 2009 11:37:00 AM > Subject: RE: [PHP] Stricter Error Checking? > > From: Tommy Pham > >> From: Tim Legg > >> > >> I jus

RE: [PHP] Stricter Error Checking?

2009-09-23 Thread Bob McConnell
From: Tommy Pham >> From: Tim Legg >> >> I just spent way, way to much time trying to debug code due to a misnamed >> element. Here is a simplified example of the problem I dealt with. >> >> >> $test = "SELECT * FROM `Materials` WHERE `Part_Number` = '125664'"; >> $result = mysql_query

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jonathan Tapicer
009 at 3:28 PM, Tommy Pham wrote: > > > - Original Message >> From: Tim Legg >> To: php-general@lists.php.net >> Sent: Wednesday, September 23, 2009 11:11:46 AM >> Subject: [PHP] Stricter Error Checking? >> >> Hello, >> >> I just spent way, way to muc

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Tommy Pham
- Original Message > From: Tim Legg > To: php-general@lists.php.net > Sent: Wednesday, September 23, 2009 11:11:46 AM > Subject: [PHP] Stricter Error Checking? > > Hello, > > I just spent way, way to much time trying to debug code due to a misnamed > ele

Re: [PHP] Stricter Error Checking?

2009-09-23 Thread Jonathan Tapicer
Hi, There is, see here (or it can also be set through php.ini): http://www.php.net/manual/en/function.error-reporting.php You are looking for E_STRICT. Regards, Jonathan On Wed, Sep 23, 2009 at 3:11 PM, Tim Legg wrote: > Hello, > > I just spent way, way to much time trying to debug code due

[PHP] Stricter Error Checking?

2009-09-23 Thread Tim Legg
Hello, I just spent way, way to much time trying to debug code due to a misnamed element. Here is a simplified example of the problem I dealt with. $test = "SELECT * FROM `Materials` WHERE `Part_Number` = '125664'"; $result = mysql_query($test,$handle); if(!$result)