## Read the current vote number from the mySQL database. my $dbh = DBI->connect("DBI:mysql:$database","$username","$password") || error_fatal ("[ vote.cgi: Admin: Unable to open mySQL database - $! ]"); my $sth_1 = $dbh->prepare("SELECT current_vote FROM vote_count;"); $sth_1->execute(); my @vote_no = $sth_1->fetchrow_array(); my $current_vote = $vote_no[0]; #### sub return_variables { my $server_root = "/var/www/"; ## MySQL database configuration. my $database = "mercury:localhost"; my $username = "mercurus"; my $password = "mercurus"; my @variables = ("$server_root","$db_database","$db_username","$db_password"); return @variables; }