jms53 has asked for the wisdom of the Perl Monks concerning the following question:
This is the code I have:
my ($first, $last) = split (' ', $user); my $id = $dbh->do(q{ INSERT INTO person SET id=?, first_name=?, las +t_name=?; }, values {id=>'NULL', first_name=> $first, last_ +name=> $last}); $dbh->disconnect;
When I test this, perl complains that I am not using a hash for the values. Should I be using a different DBI function? I have tried many combinations, and the documentation doesn't show an example.
Thank you!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Replacing DBI->do()
by Corion (Patriarch) on Apr 23, 2014 at 13:52 UTC | |
by karlgoethebier (Abbot) on Apr 24, 2014 at 10:32 UTC | |
Re: Replacing DBI->do()
by MidLifeXis (Monsignor) on Apr 23, 2014 at 13:56 UTC | |
Re: Replacing DBI->do()
by rnewsham (Curate) on Apr 23, 2014 at 13:58 UTC | |
Re: Replacing DBI->do()
by mje (Curate) on Apr 23, 2014 at 14:02 UTC | |
Re: Replacing DBI->do()
by trippledubs (Deacon) on Apr 23, 2014 at 14:40 UTC |