HI, I have written a program in Perl using the DBI module. Can I display the output of MySQL using CGI? If so please help me.
program:
#!/usr/bin/perl -w
use DBI;
print "Content-type:text/html\n\n";
$db_handle = DBI->connect("dbi:mysql:database=CYP1B1;host=localhost:192.168.3.93;")
or die "Couldn't connect to database: $DBI::errstr\n";
$sql = "SELECT * FROM BPCG";
$statement = $db_handle->prepare($sql)
or die "Couldn't prepare query '$sql': $DBI::errstr\n";
$statement->execute()
or die "Couldn't execute query '$sql': $DBI::errstr\n";
print "Location\tNucleotidechange\tAminoacidchange\n";
while(($Location,$Nucleotidechange,$Aminoacidchange)=$statement->fetchrow_array())
{
print "$Location $Nucleotidechange $Aminoacidchange \n";
}
$db_handle->disconnect();