I'm not able to get this example to work. Here is my code for totalfilms-function.inc.php where titles = the name of a table in my db:
include_once $_SERVER['DOCUMENT_ROOT'] . '/includes/db.inc.php';
$result = $GLOBALS['pdo']->query('SELECT COUNT(*) FROM titles');
catch (PDOException $e)
$error = 'Database error counting films!';
$row = $result->fetch();
The only other file I have in the totalfilms directory is error.html.php. When I load up the directory this is what I get:
It seems I need another file to display the result of the totalfilms function but I'm not sure how to write it.