in reply to Don't understand row

Probably one of your prepare statements is failing. Check the return values, and see what error you get:
$sth = $dbh_base_app->prepare($sqlstatement) or &error("SQL","Couldn't execute statement: $DBI::errstr");