"Ho, Tony" wrote:
>
> I need to detect whether or not the connection was successful.
>
> if (!$dbh) {
>
> OR
>
> if (!defined($dbh)) {
>
On success $dbh contains a database handle reference (which evaluates to
true). On failure $dbh is undef (which evaluates to false). Both tests
work but I prefer the latter.
--
Simon Oliver
- Testing DB connection Ho, Tony
- Re: Testing DB connection Simon Oliver
- Re: Testing DB connection Hardy Merrill
