> -----Original Message----- > From: Steven Vetzal [mailto:[EMAIL PROTECTED]] > Sent: Sunday, September 23, 2001 7:38 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: Avoid Error if no results > > > > > You should replace: > > > > > > $expire = $dbh->selectrow_array($sqlquery) or dbError(); > > > > > > with 2 lines: > > > > > > $expire = $dbh->selectrow_array($sqlquery); > > > dbError() unless defined($expire); > > > > > > What happens if there is something returned, but the first > > column is NULL, > > which will set $expire to undef? This will not produce the > > wanted results, > > Mike's actual SQL was a select count(*) statement, which must return > results (under non-error circumstances), so I believe my particular > example remains justified. Should your SQL statement actually request > row data, you are absolutely correct...
Yes, thanks. I overlooked the select count(*) part, while scanning through the initial email. You are correct, though since this thread is up and running I might as well ask:-) Definitelly RaiseError => provides the best solution for error catching, though at this time it must be caust with a __DIE__ handler or eval, though we discussed before about being able to assign a callback procedure to it, and Tim promissed ^H^H^H^H^H^H^H^H^H, let me take that back, mentioned that one's been on his (our) list. Tim? I know, a patch is always welcomed and I would work on it, though I'm pretty busy at this time, working on some other modules that this is almost out of the question for a few months. Can anyone be so kind as to maybe find some time for this:-? Ilya > > Steve
