Re: [PHP] Best practice for if (!$stmt->execute())

2010-10-25 Thread Paul M Foster
On Tue, Oct 26, 2010 at 06:27:33AM +0200, Rico Secada wrote: > On Mon, 25 Oct 2010 22:56:37 -0400 > Paul M Foster wrote: > > > Bear in mind, an "error" is *never* that a query returned no data or > > data the user might consider bad. > > This is an important point. When is an "error" an actual

Re: [PHP] Best practice for if (!$stmt->execute())

2010-10-25 Thread Rico Secada
On Mon, 25 Oct 2010 22:56:37 -0400 Paul M Foster wrote: > Bear in mind, an "error" is *never* that a query returned no data or > data the user might consider bad. This is an important point. When is an "error" an actual error? When is it something that *needs* to be logged and mailed? > Paul >

Re: [PHP] Best practice for if (!$stmt->execute())

2010-10-25 Thread Paul M Foster
On Mon, Oct 25, 2010 at 06:06:24AM +0200, Rico Secada wrote: > Hi. > > I have been doing like this: > > if (!$stmt->execute()) { > return false; > } else { > > ... some code > > return true; > OR > return $foo; // Some int, string, whatever. > > } > > I am thinking about ch

Re: [PHP] Best practice for if (!$stmt->execute())

2010-10-25 Thread Rico Secada
On Mon, 25 Oct 2010 00:26:23 -0700 "Tommy Pham" wrote: > > -Original Message- > > From: Rico Secada [mailto:coolz...@it.dk] > > Sent: Sunday, October 24, 2010 9:06 PM > > To: php-general@lists.php.net > > Subject: [PHP] Best practice for if (!$stmt->execute()) > > > > Hi. > > > > I have

RE: [PHP] Best practice for if (!$stmt->execute())

2010-10-25 Thread Tommy Pham
> -Original Message- > From: Rico Secada [mailto:coolz...@it.dk] > Sent: Sunday, October 24, 2010 9:06 PM > To: php-general@lists.php.net > Subject: [PHP] Best practice for if (!$stmt->execute()) > > Hi. > > I have been doing like this: > > if (!$stmt->execute()) { > return false;