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....
--------------------------------------------------------------------------------------------------------------
#!/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....