Re: REG: dbi::errstr error.
- From: jonathan.leffler@xxxxxxxxx (Jonathan Leffler)
- Date: Fri, 27 Jan 2006 22:07:44 -0800
On 1/27/06, Dilly raja <rajadilly@xxxxxxxxx> wrote:
>
> I have a cgi script adduser.cgi which collects the data from the user
> through adduser.html. when i execute this script i encountered the error
> as
> shown below.
>
> Name "dbi::errstr" used only once: possible typo at adduser.cgi line 18.
The message is precise - and Perl is case-sensitive.
the complete script of the adduser.cgi is shown below. Since i am new to
> perl and mysql i cant able to find out the reason for the error. i will
> thankful if you find out the reason for this.
>
>
> the cgi script is
>
> #!c:/perl/bin/perl -w
>
> use CGI;
> use DBI;
> my $cgi=new CGI;
>
> $name = $cgi->param("name");
> $email=$cgi->param("email");
> $phone=$cgi->param("phone");
> $address=$cgi->param("address");
> $username=$cgi->param("username");
> $password=$cgi->param("password");
>
> my $dbh=DBI->connect ("DBI:mysql:dvd","","autoraja")||
> die "Error opening database: $DBI::errstr\n";
> $sth=$dbh->prepare("insert into user(name, email, phone, address,
> username,
> password)
> values($name, $email, $phone, $address, $username,
> $password)");
> $sth->execute()||die "Unable to insert the value: $dbi::errstr\n";
> $dbh=disconnect();
>
> print "Content-type: text/html\n\n";
> print "<HTML>";
> print "<HEAD><TITLE>CGI Process: $name\n</TITLE></HEAD>";
> print "<BODY>";
>
> if($name eq "")
> {
> print "<H1>Invalid Name. Please Try Again.</H1></BODY></HTML>";
> exit (0);
> }
>
> print "The name is <b>", $name, "</b>";
> print "</BODY></HTML>";
>
>
>
> --
> Friendly,
> Raja.M
>
>
--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."
- References:
- REG: dbi::errstr error.
- From: Dilly raja
- REG: dbi::errstr error.
- Prev by Date: Reg: auto_increment issue.
- Next by Date: Re: DBD::Oracle / Instant Client segfaults
- Previous by thread: RE: dbi::errstr error.
- Next by thread: Reg: auto_increment issue.
- Index(es):
Relevant Pages
|
|