in reply to DBI error
Do you have 'RaiseError' turned on for your database handle? If not, check each prepare() and execute() call for errors (printing out the error message from $DBI::errstr or $dbh->errstr if it's available). These functions return a false value when they fail. Don't ignore this.