diff --git a/trunk/functions.pl b/trunk/functions.pl index 2d9f352..69cabbb 100644 --- a/trunk/functions.pl +++ b/trunk/functions.pl @@ -1,6 +1,7 @@ require "/var/www/perl/include.pl"; sub fill_tagcloud { + $dbh = DBI->connect("DBI:mysql:$database:$host", $user, $pass); my $sth = $dbh->prepare(qq{select text, count from tagcloud }); $sth->execute(); while (my ($text, $count) = $sth->fetchrow_array()) diff --git a/trunk/include.pl b/trunk/include.pl index 69c6ccd..0e8bb5e 100644 --- a/trunk/include.pl +++ b/trunk/include.pl @@ -1,4 +1,8 @@ use CGI::Session; use DBI; use XML::Simple qw(:strict); -$dbh = DBI->connect('DBI:mysql:gnutube:localhost', 'root', ''); + +$database = 'gnutube'; +$host = 'localhost'; +$user = 'root'; +$pass = '';