PHP Cookbook by Adam Trachtenberg, David Sklar The following corrections were made to the 1/04 reprint: Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem [6] 4th line of code under Discussion; // NOW READS: /* [6] 5th line of code under Discussion; */ HAS BEEN ADDED to end of line. (77) 1st paragraph; "overwrites the value of 'Apple'. NOW READS: "overwrites the value of 'Apples'. (234) Recipe 9.9 the second line from the bottom: "456" HAS BEEN REFORMATTED in bold, like the line "123" before it. (239) the 23rd line from the top of the page; INSERT INTO zodiac VALUES (8,'Scorpio','Scorpion','Mars','water',20,24,11,21); NOW READS: INSERT INTO zodiac VALUES (8,'Scorpio','Scorpion','Mars','water',10,24,11,21); (259) fourth non-code paragraph, second sentence "if you call DB:quote()" NOW READS: "if you call DB::quote()" [267] (actually on page 268) 10.13 Making Paginated Links...Solution code; Code lines at top of page 268: $sth = $dbh->query('SELECT * FROM zodiac ORDER by id'); $pager = new DB_Pager($sth, $offset, $per_page); $data = $pager->build(); // display each row on this page while ($v = $pager->fetchRow()) { print "$v->sign, $v->symbol ($v->id)
"; } NOW READ: $sth = $dbh->limitQuery('SELECT * FROM zodiac ORDER by id', $offset, $per_page); // display each row on this page while ($v = $sth->fetchRow()) { print "$v->sign, $v->symbol ($v->id)
"; } $data = DB_Pager::getData($offset, $per_page, $sth->numRows()); {326} Under "Solution"; The link - http://xmlrpc-epi.sourceforge.net/sample/utils/utils.php NOW READS: http://xmlrpc-epi.sourceforge.net/xmlrpc_php/index.php (365) $hash = md5($secret_word . $id); NOW READS: $hash = md5($secret_word . $cookie_value); [381] code under "Solution"; $cmd = "echo $msg | HOME=$home_dir NOW READS: $cmd = "echo $message_body | HOME=$home_dir (391) 15.4 solution for postscript type1 fonts; ImageString($image, 'I love PHP.... NOW READS: ImagePSText($image, 'I love PHP... (422) In Recipe 16.9, the 4th line from the bottom: $classname = "pc_MC_$locale.php"; NOW READS: $classname = "pc_MC_$locale"; (445) recipe 17.7, In paragraph 4, "connect to an specific LDAP server" NOW READS: "connect to a specific LDAP server." (504) Recipe 19.9 Recipe 19.9 IS NOW titled "Processing All Files in a Directory Recursively." ("Recursively" was missing) (590) index the entry for median() which points to page 138 HAS BEEN CHANGED to mean()