I'm getting an internal server error 500.I dont understand y i cant connect to the database.please help me#!/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";
In reply to unable to connect to mysql database by mdeepthi.89
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |