in reply to DBI returning error on selectrow_hashref

You're getting that error because $dbh is undefined in the code where you run the second example.
  • Comment on Re: DBI returning error on selectrow_hashref

Replies are listed 'Best First'.
Re^2: DBI returning error on selectrow_hashref
by dsb (Chaplain) on Nov 28, 2005 at 17:04 UTC
    Is it possible that this error occurs because the query returns no data? I seem to remember a similar message in a script of mine, but through debugging I found that the query was returning no results.


    dsb
    This @ISA my( $cool ) %SIG
      No, the error is caused by $dbh having nothing in it.
Re^2: DBI returning error on selectrow_hashref
by bradcathey (Prior) on Nov 28, 2005 at 20:40 UTC

    That was it. Funny, 'cuz I always connect to the database first...except this time. Thanks. And now, when I get that error, I can Super Search PMs :-)


    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot