#!/usr/bin/perl -Tw
use CGI qw(:standard);
#use CGI::Carp;
use DBI;
my $dbh = DBI->connect("DBI:mysql:book","user", "password");
$|++; # Make the pipes piping hot!
my $cgiquery = new CGI;
my $myself = $cgiquery->self_url;
print $cgiquery->header(-expires=>'now');
print $cgiquery->start_html(-"title"=>'Entry Administration ',
-"author"=>'brian@brie.com',
-"meta"=>{'keywords'=>'brian database',
'copyright'=>'Copyright 1997 Big Brie'},
-"BGCOLOR"=>'white');
print "<H1 ALIGN=center>Database Administration Interface</H1>\n";
print '<P ALIGN=center>Developed by the man himself<BR><BR><A HREF="http://www.brie.com/brian/>Mr. Brian Lavender</A>' , "\n";
print "<H2>Table of data waiting for administration</H2>\n";
print '<A HREF="http://brie.com/cgi-bin/testing/database01.pl>Public User Page</A>';
print "\n\n";
print "<P>This page will have new features coming.\n";
print '<P>' , "\n";
print 'It will have a methods of moving the data into the other table, removing it,
and editing it. It will also require a password for access';
print "<P>\n";
my $query = "select * from entries";
my $sth = $dbh->prepare($query);
if ($sth->execute) {
print "<TABLE BORDER CELLPADDING=5>\n"; #Make this table a real table
print "<TR>\n";
foreach (@{$sth->{NAME}}) { # print the Headers of the table
print "<TH>", $_ , "</TH>\n";
}
print "</TR>\n";
print "\n";
while (my @row = $sth->fetchrow()){ #Get each row from the Msql object
print "<TR>\n";
foreach (@row) { # print all the elements
print "<TD>", $_ , "</TD>\n";
}
print "</TR>\n";
}
print "</TABLE>\n";
}
print q{
<P>
<HR>
<FONT SIZE=-1>
<ADDRESS>
<A HREF="http://www.brie.com><IMG SRC="/pictures/smllogo.gif" ALIGN=baseline WIDTH=50 BORDER=0 HEIGHT=34></A>
(C) 1997
<P>
<A HREF="http://www.brie.com><B>Brie Web Publishing</B></A><BR>
PO Box 19184<BR>
Sacramento, CA 95819<BR>
(916) 443-6195
</ADDRESS>
<FONT SIZE=-1>
};
print $cgiquery->end_html, "\n"; # That is the end of it