SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Feb 2013
    1 Post(s)
    0 Thread(s)

    PHP and MySQL: Novice to Ninja - Chapter Six totaljokes-function

    I'm not able to get this example to work. Here is my code for where titles = the name of a table in my db:
    PHP Code:
    include_once $_SERVER['DOCUMENT_ROOT'] . '/includes/';
    try {
    $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:
    Screen Shot 2013-11-02 at 10.39.09 AM.png
    It seems I need another file to display the result of the totalfilms function but I'm not sure how to write it.
    Attached Images Attached Images


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts