Having recently bought 'Build Your Own Database Driven Web Site Using PHP & MySQL'. I went through the installation process and everything was absolutely fine. Unfortunately I had to do a restore and went through the installation again. I am having hair pulling out inducing problems now.
I have a simple count example that utilises an include, so there is a folder with index.php in it which has an include statement that displays the output in a count.html.php php file. This works fine.
I then have this example which is constantly producing the following:
The website encountered an error while retrieving http://localhost/output/. It may be down for maintenance or configured incorrectly.
Here are some suggestions:
Reload this webpage later.
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
The codes is as follows and password is replaced with my root password:
$link = mysqli_connect('localhost', 'root', 'password');
$output = 'Unable to connect to the database server.';
Hopefully someone can help me out, it would be greatly appreciated.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php echo $output; ?>