in reply to DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at

Why do you use $DBI::errstr? Oh, i see, the docs for DBD::mysql mix it up. Try looking at $dbh->errstr (as seen in the examples at the top of the documentation) instead to see if there's a difference.

Did you

  1. try the statement directly in the mysql client?
  2. make sure no other transactions are currently locking the table?
  3. try $dbh->ping() as a basic test to see if your connection to the database actually works?
  4. check what $dbh->errstr shows directly after the DBI->connect() call?
  5. re-install/recompile DBD::mysql to make sure you are using the correct version of the C library?
  6. check the database logfiles? Is there anything in them that might hint at an error?

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
Also check out my sisters artwork and my weekly webcomics
  • Comment on Re: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at

Replies are listed 'Best First'.
Re^2: DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at
by Digioso (Sexton) on Oct 30, 2024 at 13:22 UTC
    Edit:
    Dang... I found the issue. I've reused $sth within the while loop...
    Thanks a lot for your help, everyone!