Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: DBI quote: invalid number of parameters

by Trimbach (Curate)
on Feb 23, 2003 at 02:55 UTC ( #237849=note: print w/replies, xml ) Need Help??


in reply to DBI quote: invalid number of parameters

An easier way is to let DBI do the escaping automatically for you with placeholders. Try this:
my $sth = $dbh->prepare( "INSERT INTO member (nickname, password, first_name, last_name, email, + country, homepage, im_type, im_id, info) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); $sth->execute($nickname, $pass1, $firstname, $lastname, $email, $count +ry, $homepage, $imtype, $imid, $info) or die "execute failed: $DBI::errstr\n";
I suspect you have an undef value in one of your variables that's throwing off your INSERT. This way you shouldn't have to worry about it.

Gary Blackburn
Trained Killer

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2021-10-27 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (94 votes). Check out past polls.

    Notices?