Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Could someone help me. I'm new to CGI. I encoded the following code and got an error message which i don't know how to fix it.
#!/usr/bin/perl print "Content-type:text/html\n\n"; use DBI; use CGI; $query = new CGI; my $dbh=DBI->connect('DBI:mysql:test','edward','password'); my $logname=$query->param('log'); my $passwd=$query->param('pass'); my $sth=$dbh->prepare(<<End_SQL); SELECT * from login where log = "$logname" End_SQL $sth->execute(); @row=$sth->fetchrow_array; $dbh->disconnect(); print <"TESTING</br>">; print "</body></html>";
when i try to check this using the "./new.response.cgi" command, i get the following error.
Content-type:text/html DBI::db=HASH(0x81dc3e0)->disconnect invalidates 1 active statement han +dle (eithe r destroy statement handles or call finish on them before disconnectin +g) at ./new.response.cgi line 22.
Hope u could help me.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI Error
by BBQ (Curate) on Jul 10, 2000 at 07:26 UTC | |
|
Re: DBI Error
by btrott (Parson) on Jul 10, 2000 at 07:18 UTC | |
|
Re: DBI Error
by turnstep (Parson) on Jul 10, 2000 at 14:59 UTC | |
|
Re: DBI Error
by agoth (Chaplain) on Jul 10, 2000 at 13:12 UTC |