nerves — 2013-11-02T13:47:47-04:00 — #1
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.
guido2004 — 2013-11-02T14:02:31-04:00 — #2
I guess your index.php is missing. Are you sure in the book there isn't another part of the example?
nerves — 2013-11-02T14:27:48-04:00 — #3
Thanks! The book doesn't mention it but the missing files are included in the code archive.