When using the code below the browser shows absolutely nothing, not even the debug message "Unable to connect to MySQL"....why is this happening, is there something wrong with the way mySQL is setup or Apache??
It does manage to print out simple variable values in the browser, but I get no response when trying to connect to my database. Any help much appreciated.
<?php
$username = "foousername";
$password = "foopass";
$hostname = "localhost";
echo $username;
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
// you're going to do lots more here soon
mysql_close($dbh);
?>
It does manage to print out simple variable values in the browser, but I get no response when trying to connect to my database. Any help much appreciated.
<?php
$username = "foousername";
$password = "foopass";
$hostname = "localhost";
echo $username;
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
print "Connected to MySQL<br>";
// you're going to do lots more here soon
mysql_close($dbh);
?>