I am attempting to complete ch.4 of PHP & MYSQL 5th ed. I have gone over the code repeatedly and can find no errors. When I attempt to view in browser I receive only a blank page. lol This code seems awful simple to be having an issue with. Help is GREATLY appreciated.
index.php
<?php
try
{
$pdo = new PDO('mysql:host=localhost;dbname=ijdb', 'ijdbuser','password');
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$pdo->exec('SET NAMES "utf-8"');
}
catch (PDOException $e)
{
$output = 'Unable to connect to database server:' . $e->getMessage();
include 'output.html.php';
exit()
}
$output = 'Database connection established,';
include 'output.html.php';
_________________________________________________________________
output.html.php
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Script Output</title>
</head>
<body>
<p>
<?php echo $output; ?>
</p>
</body>
</html>