use DBI;
$vs="db";
$hostname="localhost";
$username="dbuser";
$password="dbpass";
$db = DBI->connect("DBI:mysql:$vs:$hostname", $username, $password);
$query = $db->prepare("INSERT INTO log SET REQUEST=\'$URL\'");
$query->execute;
$query->finish;
$db->disconnect;
I want this cgi program to execute a mysql query, and once I put in the code, it gave me a 500 internal server error through a browser. I then ran the script with a cgi checker, and it gave me the following errors...
1 Global symbol "$vs" requires explicit package name line 1126.
2 Global symbol "$hostname" requires explicit package name line 1127.
3 Global symbol "$db" requires explicit package name line 1130.
4 Global symbol "$vs" requires explicit package name line 1130.
5 Global symbol "$hostname" requires explicit package name line 1130.
6 Global symbol "$query" requires explicit package name line 1131.
7 Global symbol "$db" requires explicit package name line 1131.
8 Global symbol "$query" requires explicit package name line 1132.
9 Global symbol "$query" requires explicit package name line 1133.
10 Global symbol "$db" requires explicit package name line 1134.
11 BEGIN not safe after errors--compilation aborted line 3433.
Any ideas on why this is happening?? I wish this was a php script!! I like php a lot better than perl!