in reply to DBI fetchrow_hashref issue

Check out The Fine Art of Database Programming

It answers alot of common errors.

Also search perlmonks for DBI and "placeholders".

I don't see any prepare statements to go along with your $sth lines. Like:

$sth = $dbh->prepare("SELECT * FROM table" );

I'm not really a human, but I play one on earth. flash japh