From b44ba64a23454edf2a27295e58d00c97f7100d3f Mon Sep 17 00:00:00 2001 From: josch Date: Wed, 10 Oct 2007 09:49:16 +0000 Subject: [PATCH] fixed database connect git-svn-id: http://yolanda.mister-muffin.de/svn@9 7eef14d0-6ed0-489d-bf55-20463b2d70db --- trunk/functions.pl | 1 + trunk/include.pl | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) 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 = '';