Hello pls help me out.I've been working on this for the past 6hrs.cant figure out what am i doing wrong
#!/usr/bin/perl
use DBI;
use strict;
use warnings;
# Database settings
my $database = "website";
my $username = "test";
my $password = 'testtest';
my $table = "apartments";
# Connect to database
my $dbh = DBI->connect("dbi:mysql:database=$database;host=localhost;us
+er=$username;password=$password") or die "Couldn't connect to databas
+e: $DBI::errstr\n";
my $sth = $dbh->prepare("select * from $table')") or die "Couldn't pre
+pare statement: $dbh->errstr\n";
$sth->execute() or die "Couldn't execute query 'sql': $DBI::errstr\n";
I'm getting an internal server error 500.I dont understand y i cant connect to the database.please help me