in reply to Re^2: Help on fetchrow_hashref!
in thread Help on fetchrow_hashref!

Yes. Don't call die but store the message somewhere and then call exit.

Replies are listed 'Best First'.
Re^4: Help on fetchrow_hashref!
by Anonymous Monk on Nov 09, 2010 at 19:30 UTC
    OK, could you give example of that on this code?
    my $sth = $dbh->prepare("select * from mytable where user_name = ? ") +or or &die("Can't select: + ",$DBI::errstr); $sth->execute($user) die "Execute failed: ", $DBI::errstr;

    How could you redirect any errors here to a special page or a sub routine to print a better error to the users?

      What part exactly do you have problems with?

      If you don't want to die, don't call that routine.

        I am just trying to have a way if something goes wrong to redirect to another place instead of having SQL information on the screen when something happens like database not been able to connect or something else.