#!/usr/bin/perl use CGI::Carp qw(fatalsToBrowser); use warnings; use strict; use CGI qw/:standard/; use DBI; ################### # configurations ################### my $dbase = "spyders_test"; my $mysql_user = "spyders_admin"; my $mysql_pass = "pass"; my $table1 = "table1"; ################### # end configurations ################### print header; my $dbh = DBI->connect("DBI:mysql:$dbase", $mysql_user, $mysql_pass) or print DBI->errstr; print "Connection was made
";
##########
# Altavista
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS altavista
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Altavista table created.
"; }
##########
# Google
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS google
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Google table created.
"; }
##########
# Alexa
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS alexa
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Alexa table created.
"; }
##########
# AllTheWeb
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS alltheweb
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "AllTheWeb table created.
"; }
##########
# Entireweb
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS entireweb
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Entireweb table created.
"; }
##########
# Excite
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS excite
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Excite table created.
"; }
##########
# Galaxy
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS altavista
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Altavista table created.
"; }
##########
# Euroseek
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS euroseek
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Euroseek table created.
"; }
##########
# Infoseek
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS infoseek
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "InfoSeek table created.
"; }
##########
# Lycos
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS lycos
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Lycos table created.
"; }
##########
# MSN
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS msn
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "MSN table created.
"; }
##########
# NothernLight
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS northernlight
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "NorthernLight table created.
"; }
##########
# Teoma
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS teoma
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Teoma table created.
"; }
##########
# JUNK TEST
##########
my $sth = $dbh->prepare(
"CREATE TABLE IF NOT EXISTS junk
(
id int auto_increment not null,
useragent char(32) NOT NULL,
ip char(32) NOT NULL,
date char(32) NOT NULL,
primary key (id)
)");
$sth->execute();
if ($sth->errstr) { print $sth->errstr; }
else { print "Junk table created.
"; }
$dbh->disconnect
or warn "Couldn't disconnect from database: $DBI::errstr";
exit;