Product Overview

Hooray! A new and improved edition on this book is now available!

The 1st edition of The PHP Anthology: Object Oriented PHP Solutions was a fine book but we replaced it with a new and updated edition in November 2007.

However, if you do happen to own a copy of 'The PHP Anthology: Object Oriented PHP Solutions - 1st edition' you may still be interested in:

The PHP Anthology: Object Oriented PHP Solutions

Corrections & Typos

first edition

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

Confirmed errors in the May 2005 reprint:

Some of the errors listed here may also apply to the previous edition (see below), although page numbers may differ in some cases.

  • Volume I
    • p.77 code listing 1
      Two methods were left out of the listing for the MySQLResult class:
          /**
           * Returns the number of rows selected
           * @return int
           * @access public
           */
          function size () {
              return mysql_num_rows($this->query);
          }
          /**
           * Returns the ID of the last row inserted
           * @return int
           * @access public
           */
          function insertID () {
              return mysql_insert_id($this->mysql->dbConn);
          }
      The code archive does already include this code; the error was in the printed listing only.
    • p.83 code listing 2
      The semicolon at the end of the line should be removed.
    • p.83 code listing 3
      The semicolon at the end of the SQL query should be removed:
      $sql = "INSERT INTO articles SET title='$title'";
    • p.218 code listing 2
      ThumbNail should be Thumbnail in the comment on the second line.
    • p.218 code listing 3
      ThumbNail should be Thumbnail in the comment on the second line.
    • p.219 code listing
      ThumbNail should be Thumbnail on the first line.
    • code archive, WebPageElements 16.php
      When you load this page for the first time you get an error from SPLIB\UI\Menu.php line 80. The fix is to change Menu.php line 79 to:
      if ( $result->size() != 1 && strlen($location) > 0 ) {
  • Volume II
    • p.40 code listing 2
      $fonts = array(2, 3, 4, 5); should be $fonts = $this->fonts;.

Confirmed errors in the August 2004 reprint:

Some of the errors listed here may also apply to the previous edition (see below), although page numbers may differ in some cases.

The credits page of this edition identifies the printing date as August 2004.

  • Volume I
    • p.ix last paragraph
      PEAR stands for "PHP Extension and Application Repository", not "PHP Application and Extension Repository".
    • p.18 paragraph 3
      "The best way to be sure that they are..." should be "The best way to be sure that it does run..."
    • p.47 paragraph 2
      The sentence beginning with "Switched off" is confusing. Rephrased: "With it switched off, PHP will generate a warning every time a function call attempts to pass an argument by reference."
    • p.75
      The first line on this page is a duplicate of the last line on the preceding page and should be removed.
    • p.77 code listing 2
      $result = $db->query($sql); should be $result = &$db->query($sql);.
    • p.181 code block
      In the delcaration of the setTimeStamp method, $timestamp should be $timeStamp.
  • Volume II
    • p.50 code listing
      if (!$mail->Send()) { should be if ($mail->Send()) {.
    • p.225 code listing
      $client_ip should be $_SERVER['HTTP_CLIENT_IP'].

Confirmed errors in the February 2004 reprint:

Some of the errors listed here may also apply to the previous edition (see below), although page numbers may differ in some cases.

The credits page of this edition identifies the printing date as February 2004.

  • Volume I: Foundations
    • p.75 code listing 2
      @param $sql string should be @param string $sql
      return statement belongs after the closing } of the if statement.
    • p.151
      Wrapping in Figure 5.1 should match preceding code.
    • p.156 code listing 1
      Missing [u] tag before action[/u]
    • p.156 code listing 2
      Missing <span style="text-decoration: underline;"> before action</span>
    • p.159
      PEAR::Validate has been updated since the release of the book. Information about changes in recent releases is available here.
    • p.160 paragraph 1
      The url method is now called uri, as of PEAR::Validate 0.3.0.
    • p.160 code listing 1
      In order for this code to work with PEAR::Validate 0.3.0 or later, call to Validate::urlmust be changed to Validate::uri.
    • p.224 paragraph 5
      imagefontload should be imageloadfont
    • p.230 code listing 2
      bar plot should be pie chart
    • p.269
      PEAR::HTML_QuickForm has been updated since the release of the book. Information about migrating to version 3.2 is available here.
    • p.276 code listing 1
      Maximum character count for password field incorrectly set to 50 instead of 12.
  • Volume II: Applications
    • p.52 code listing 1
      $this->dbConn->fetch($sql) should be $this->db->query($sql).
    • p.63 code listing 1
      The constants PERM_TABLE, PERM_TABLE_ID, and PERM_TABLE_NAME are declared twice in this code, when they should only be declared once.

Confirmed typos in the December 2003 First Edition:

  • Volume I: Foundations
    • p.27 code listing 1
      Prodecural should be Procedural
    • p.33 code listing 1
      Extra > before align attribute in <p> align=\"center\">
    • p.47 code listing 1
      display(&$message) should be display(&$myMessage)
    • p.47 code listing 3
      display($message) should be display($myMessage)
    • p.50 paragraph 1
      getMethod should be getMessage
    • p.50 paragraph 4
      "in the child class is overrides"
    • p.109
      "Generating PHP Database Access Layers" appears twice in the list.
    • p.109
      URL for Zend Tutorial on Fulltext Searches should be: http://www.zend.com/zend/tut/tutorial-ferrara1.php
    • p.197 code listing 1
      $_SERVER['PHP_SELF'] . "?y" .
      should be
      $_SERVER['PHP_SELF'] . "?y=" .
    • p.200 code listing 1
      $_SERVER['PHP_SELF'] . "?y" .
      should be
      $_SERVER['PHP_SELF'] . "?y=" .
    • p.267
      4.php
    • p.274
      "format" should be monospaced like the other arguments.
    • p.275, 284, 287
      All occurrences of mysql_real_escape_string should be mysql_escape_string.
  • Volume II: Applications
    • p.175 tip block
      The Adobe FTP link is no longer valid. About.com has a list of sources for free .afm fonts: http://desktoppub.about.com/cs/postscriptfonts/


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