Product Overview

Looking for the old edition of “Build Your Own Database Driven Web Site Using PHP & MySQL, 4th Edition?
Download the code archive or view errata of the old edition here.

Build Your Own Database Driven Web Site, 4th Edition

Corrections & Typos

Find a mistake not listed here? Contact us to let us know!

July 2009

  • p.12 Installing PHP

    Although this book provides download and installation instructions for PHP 5.2, the newly-released (at the time of this writing) PHP 5.3 includes some new download options that aren’t covered in the book.

    There are four different versions of PHP 5.3. for Windows: VC6 Non Thread Safe, VC6 Thread Safe, VC9 Non Thread Safe, and VC9 Thread Safe. Talk about confusing!

    First of all, you definitely want a Thread Safe version of PHP. The Non Thread Safe versions are not suitable for use as a plugin for Apache.

    Secondly, assuming you will install (or have already installed) a version of the Apache HTTP Server from httpd.apache.org (see page 13), you will need the VC6 version of PHP.

    In short, to follow the instructions in this book, you need the VC6 Thread Safe version of PHP 5.3 for Windows.

  • p.15 Step 2 As of PHP 5.3, the file you want to duplicate is called php.ini-development, not php.ini-dist.
  • p.17 code block 3

    In PHP 5.3, the extension_dir line of php.ini-development is commented out by default, so you need to remove the semicolon from the beginning of the line when adding the directory information.

  • p.42 2nd code block

    As of PHP 5.3, the file you want to duplicate is called php.ini-development, not php.ini-dist. So the last line of code should be:

    cp php.ini-development php.ini
  • p.49 code block

    As of PHP 5.3, the date function requires that a timezone be specified. Running the code as is will result in a warning to this effect. To fix this, edit the php.ini file and include a line like:

    date.timezone = America/New_York

    (a list of supported timezones can be found at http://php.net/manual/en/timezones.php)

  • p.58 command output As of MySQL 5.5.3, there is now an additional database called performance_schema, so if you're using a more recent version it's normal that the SHOW DATABASES; command will list four databases instead of three.
  • p.62 last paragraph DATA should be DATE
  • p.95

    On pages 95 and 96, the book refers to welcome6.html and welcome6.php, which we've never explicitly said to create. You can still find these files in the code archive to follow along with the book. welcome6.php differs from welcome5.php in that we're using the general-purpose $_REQUEST variable rather than $_POST.

  • p.128 and on db.inc.php samples In every example taken from db.inc.php, all of the error handlers except one correctly set the $error variable and include error.html.php, but one of them sets $output and includes output.html.php, which is incorrect, as this file doesn't exist. It should be $error and error.html.php throughout.
  • p.138 2nd paragraph

    The first sentence should read "... by letting you insert special headers into the response sent to the browser."

  • p. 161 code listings

    In the first code listing, lines 14 and 15 should be:

    $jokes[] = array('id' => $row['id'], 'text' => $row['joketext'],
        'name' => $row['name'], 'email' => $row['email']);

    The second code listing is an excerpt from the file chapter5/jokes/jokes.html.php, and not index.php as printed.

  • p.206 code listing Halfway down the page, the variable $jokeId is created with $jokeId = $row[0];. On the next line (after the comment), this variable is incorrectly referenced in the SQL DELETE statement as $jokeid (lowercase 'i'). It should be $jokeId in both places.
  • p.287 The chapter9/admin/login.html.php example has a typo. The second line from the bottom should be
    
    <p><?php htmlout($loginError); ?></p>
    
    The htmlout helper function already includes an echo, so the echo statement in this example was redundant.
  • p.405 3rd code block OPTIONALY should be OPTIONALLY.


Instant Download!
This title available in Adobe PDF, Kindle (mobi) and ePub (IOS) formats

SitePoint Books

  • advocate best practice techniques
  • lead you through practical examples
  • provide working code for your web site
  • make learning easy and fun

100% Money Back Guarantee