I am getting the error "Can't call method "prepare" on an undefined value at..." with the following code:
<code>my %dbh;
my $dbh = DBI->connect("DBI:mysql:Customer_Data",
$username,
$password
) or die "Database connection failed.";
$myquery="SELECT * from Site";
$execute = $connect->prepare($myquery);
$execute->execute() or die $dbh->errstr;
</code>
Can anyone suggest what might be the problem?