|
ugg,
im trying to manipulate mysql tables using perl. I seem to be having trouble connecting to the database and im guessing im doing a few other things wrong as well. my code looks like this. i upload the code to the cgi-bin provided by my hosting complany and when i go to the url i get a blank page. any ideas? should i be using local host there?
#!/usr/bin/perl
# PERL MODULES WE WILL BE USING
use DBI;
use DBD::mysql;
# HTTP HEADER
print "Content-type: text/html \n\n";
# CONFIG VARIABLES
$database = "sluc@!#$y_!@#!@#project";
$user = "slu@#$#@$#@ch";
$pw = "wa@#$#@23";
$host= "localhost";
$tablename="friends"
# PERL MYSQL CONNECT
$connect = Mysql->connect($host, $database, $user, $pw);
# LISTDBS()
@databases = $connect->listdbs;
foreach $database (@databases) {
print "$database<br />";
}
|