Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: DBI quote: invalid number of parameters

by Trimbach (Curate)
on Feb 23, 2003 at 02:55 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found