http://www.perlmonks.org?node_id=237844

Baiul has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I am having great difficulties in getting my script to work with perl/mysql. I am no Guru but basically I am making a registration page for my users and the script just takes their details and inputs them into the mysql DB. I am getting the following error

DBI quote: invalid number of parameters: handle + 0 Usage: $h->quote($ +string [, $data_type ]) at usersetup2.cgi line 360.
Here is the snippet of code which is affected,

my ($nickname, $pass1, $firstname, $lastname, $email, $imtype, $imid, +$info, $country, $homepage) = (. $nickname = $dbh->quote(param('username')),. $pass1 = $dbh->quote(param('password1')), $firstname = $dbh->quote(param('firstname')), $lastname = $dbh->quote(param('lastname')), $email = $dbh->quote(param('email')), $imtype = $dbh->quote(param('imtype')), $imid = $dbh->quote(param('imid')), $info = $dbh->quote(param('info')), $country = $dbh->quote(param('country')), $homepage = $dbh->quote(param('homepage')) ); # Query the database. my $sth = $dbh->prepare( "INSERT INTO member (nickname, password, firs +t_name, last_name, email, country, homepage, im_type, im_id, info) VA +LUES ($nickname, $pass1, $firstname, $lastname, $email, $country, $ho +mepage, $imtype, $imid, $info)"); $sth->execute or die "execute failed: $DBI::errstr\n"; $sth->finish or die "execute failed: $DBI::errstr\n";<
Basically I got in this mess by trying to escape the characters like @ from screwing up the DB. This is on a paid host and I cannot upgrade the DBI module so I was wondering if anyone had any other ideas? The connection works fine and all of the params are being picked up ok too. They work ok if I just want to print them.

Thanks for the help!
Baiul.

Ubi Concordia Ibi Victoria