Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/usr/bin/perl
print "Content-type: text/html\n\n";
use DBI;
$db = 'xxxxxxxxxxdb';
$host = 'xxx.xxxxxxxxxx.co.uk';
$db_user = 'xxxxx';
$db_password = 'xxxxx';
##################################################
$dbh = DBI->connect("dbi:mysql:$db:$host", "$db_user", "$db_password") || die ("Cannot connect to the database");
$sth = $dbh->prepare("SELECT * FROM [red]employees[/red]");
$sth->execute(); if ($sth->err) {die "Error ", $sth->err;}
##################################################
print "<table border='1'>\n";
while (@row = $sth->fetchrow_array) {
print " <tr>\n";
foreach $field (@row) {
print " <td>$field</td>\n";
}
print " </tr>\n";
}
print "</table>\n";
##################################################
$sth->finish;
$dbh->disconnect;
bknox (TechnicalUser) May 4, 2004
A good reference is Programming the Perl DBI book by Descartes and Bunce. ISBN: 1-56592-699-4