in reply to Re: Can I get the actual error for DBI->execute() ?
in thread Can I get the actual error for DBI->execute() ?

Perhaps a stray quote or backslash in one of the $celldata or something like this -- think

A stray quote was exactly the issue, and I have taken care of that. But I would still like to catch any errors, without dying, reporting themm back to the enduser, and then exit the script gracefully.

  • Comment on Re^2: Can I get the actual error for DBI->execute() ?

Replies are listed 'Best First'.
Re^3: Can I get the actual error for DBI->execute() ?
by NERDVANA (Priest) on Jun 24, 2024 at 19:12 UTC
    I'm surprised nobody else came right out and said this yet: Your code is vulnerable to SQL injection. You should never interpolate Perl variables into SQL because DBI gives you a placeholder system that solves the problem the right way. Write your query with "?" for each value and then plug the values into the execute call.
Re^3: Can I get the actual error for DBI->execute() ?
by ForgotPasswordAgain (Vicar) on Jun 22, 2024 at 02:13 UTC
    You have RaiseError => 0. Set it to 1 and wrap it in an eval. I'd also recommend using placeholders instead of interpolating variables in strings.