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!
Ubi Concordia Ibi Victoria
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.