Gossamer Forum
Home : General : Perl Programming :

Can you track wats the problem in this code !!!!

Quote Reply
Can you track wats the problem in this code !!!!
I am newbie in cgi programming.I have a problem in this program.
--------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl -wT
use CGI qw/:standard/;
use warnings;
use diagnostics;
use strict;
use DBI();
print "Content-type:text/html\n\n";
my @row;
my $a="PortAransas";
print header,start_html('A Simple Example'),h1('A Simple Example');
my $dbh=DBI->connect("DBI:mysql:database=test",undef,undef,{ RaiseError => 1, AutoCommit => 0 })||die "Unable to connect $DBI::errstr";
my $sth = $dbh->prepare("select * from TAMUCCneuralnet where station=?")|| die "Unable to insert $DBI::errstr";
$sth = $dbh->execute($a);
while(@row=$sth->fetchrow_array())
{
print @row;
}
$sth = $dbh->finish();
$dbh->disconnect();
end_html;
--------------------------------------------------------------------------------------------------------------
Error : Can't locate object method "execute" via package "DBI::db" at ./tp.cgi line 12.

THE TABLE EXISTS AND I'M NOT GETTING ANY RESULTS.CAN SOMEONE HELP ME WITH THIS....
Subject Author Views Date
Thread Can you track wats the problem in this code !!!! karthik 4947 Jul 28, 2004, 2:31 PM
Thread Re: [karthik] Can you track wats the problem in this code !!!!
Chaz 4804 Jul 28, 2004, 3:11 PM
Thread Re: [Chaz] Can you track wats the problem in this code !!!!
karthik 4825 Jul 28, 2004, 4:17 PM
Post Re: [karthik] Can you track wats the problem in this code !!!!
Chaz 4769 Jul 28, 2004, 7:30 PM