in reply to Re: Re: Unexplained MySQL Error
in thread Unexplained MySQL Error
To answer your concerns though, $child is checked before getParentCategory is called. It should never be empty, and if it is, it will result in an easily interpreted error. I log the query to the error logs as well as the SQL error so that I can easily locate the source of a problem. Perhaps there should be a die() involved, but that's neither here nor there.
getDb() gets a global database handle that has been tested for success at the beginning of the script. And I can't simply return $res straight away, since I'm returning only the first element - not the reference itself - and if it's undef, then it will fail (undef->[0] causes an error)
Cheers
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Unexplained MySQL Error
by jbeninger (Monk) on Jul 21, 2003 at 13:54 UTC | |
by Anonymous Monk on Jul 21, 2003 at 14:06 UTC | |
by jbeninger (Monk) on Jul 21, 2003 at 14:31 UTC |