Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: DBI sudden exit on MySQL insert

by mreece (Friar)
on Apr 19, 2007 at 16:54 UTC ( #610990=note: print w/replies, xml ) Need Help??


in reply to DBI sudden exit on MySQL insert

i can't answer your question, but i recommend you check for errors from prepare as well. (one possibility is that one of your keys is not a column of $table, but i would expect to see an error trying to call execute on an undefined value.)
my $sth = $dbh->prepare($sqlstatement) or die "cannot prepare: $DBI::errstr";
unrelated, but you can also simplify the top part of your function a bit:
my @values = values %$data; my $keylist = join ',', keys %$data; my $qlist = join ',', ('?') x @values;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://610990]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2021-01-22 03:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?