in reply to unable to connect to mysql database
my $sth = $dbh->prepare("select * from $table')") [download]
Adding use CGI::Carp "fatalsToBrowser"; at the top of the script might help you see what is happening.