Larry Ullman

Translating Geek Into English

"PHP 5 Advanced: Visual QuickPro Guide" 2nd Edition Errata

5 mins to read

PHP 5 Advanced:\ Visual QuickPro Guide

Unfortunately, despite the best efforts of myself, the technical editor, the copy editor, the line editor, the proofreader, and despite the multiple revisions, errors still occur. This page lists all the errors found in the book since it went to print.

Note: errors are corrected in subsequent printings and therefore your particular copy may not contain all of the following. You may also be experiencing problems not caused by a mistake in the book. If so, you may find the solution to your problem by using the book’s corresponding forum. Significant changes in the technology will be addressed there and you can also find problems and solutions encountered by other readers.

Known Errors in the Book:

ChapterPage #DescriptionDate Added1: Advanced PHP Techniques10The “tasks” table definition as is won’t work properly. When the date_completed column is updated, it also updates the date_added. This occurs because MySQL updates the first TIMESTAMP column in the table when that record is inserted or updated. The solution would be to define both date_added and date_completed as DATETIME, then change the INSERT queries to set the date_added column to NOW().August 30, 20071: Advanced PHP Techniques15On the second line of code under Step 9, the word “its” should not be there. The corresponding script is correct.April 1, 20071: Advanced PHP Techniques16In Step 12, the fieldset should be closed before the form is closed. This also applies to lines 79 and 80 of Script 1.2 and lines 69 and 70 of Script 1.6.April 1, 20071: Advanced PHP Techniques39In the first step, add_task.php should refer to Script 1.2, not Script 1.1.2: Developing Web Applications76The comment on line 15 of Script 2.7 should state that the cache interval is 6 hours, not 24.May 19, 20083: Advanced Database Concepts96In the very last sentence, it should say One source of… (“One” instead of “Once”).May 21, 20073: Advanced Database Concepts97In creating the zip_codes table, the longitude field should be defined as DOUBLE(9,6) instead of DOUBLE(8,6) to accommodate longitudes, like Hawaii and Washington state, that have 3 digits in front of the decimal point.July 10, 20073: Advanced Database Concepts105If a database connection cannot be made on line 31, the error message (within the die()) should have a closing P tag. This also applies to Step 3 on page 106.November 5, 20083: Advanced Database Concepts105The query ending on line 47 of Script 3.3 should have the final closing parentheses after 69.09. This also applies to the code in Step 6 on page 107.October 26, 20093: Advanced Database Concepts111Midway down the page, it should say RETURN data, not RETURNS.January 27, 20123: Advanced Database Concepts115The query in Step 10 has an extra - before 95.276050.July 9, 20084: Security Techniques125The function referenced in item 10 should be mysqli_real_escape_string().May 19, 20084: Security Techniques139The comment on line 47 of Script 4.2 should read Strip tags and encode quotes:.August 30, 20074: Security Techniques147The $auth->start() line needs to be before the opening HTML (line 42) if you’re not using output buffering.November 5, 20084: Security Techniques159The first line of code is missing an “i” in “deinit”. It should read mcrypt_generic_deinit($m);.January 26, 20085: E-Commerce Techniques172The first entry in Tables 5.4, 5.5, and 5.6 should be of type TINYINT.July 9, 20085: E-commerce Techniques201Line 60 of Script 5.5 should be if (mysqli_num_rows($r) >= 1) {. This change also applies to the last line of code under Step 7 on page 203.May 14, 20075: E-Commerce Techniques203In the code under Step 8, the echo statement should have …gw_id=$gw_id…. The corresponding script is correct.July 9, 20085: E-Commerce Techniques207Line 57 of Script 5.6 should be if (mysqli_num_rows($r) >= 1) { This also applies to Step 6 on page 209.November 5, 20085: E-Commerce Techniques209On line 5 of the code under Step 6, the variable should be $gw_id, not $gwid. The right code is USING (size_id) WHERE gw_id=$gw_id. The code in the corresponding script is correct.January 26, 20085: E-Commerce Techniques216On line 148 of Script 5.7, the bold tag isn’t properly closed after “Total:".October 25, 20086: Basic Object-Oriented Programming238On line 20 of Script 6.1, and in the code under step 5, the Dutch version should be Hallo, wereld!. This also affects Figure 6.1 on page 243.May 14, 20076: Basic Object-Oriented Programming250In the last Tip, it should say that both rectangles have the new dimensions as $r1 and $r2 refer to the same object. In PHP 4, $r1 and $r2 would be two different objects.July 10, 20076: Basic Object-Oriented Programming250The third line of code in the second tip should read return ($this->width \* $this->width);November 8, 20077: Advanced Object-Oriented Programming264In the last sentence of the third paragraph, “reusability” is misspelled.July 9, 20087: Advanced Object-Oriented Programming265In Figure 7.4, ‘attribute4’ of GrandchildClass should not be grayed out as it does not appear in ChildClass.April 1, 20077: Advanced Object-Oriented Programming267The title value in the code for Step 1 (right-hand column) should be “Pets”, not “Rectangle”. The corresponding script is correct.July 9, 20087: Advanced Object-Oriented Programming283Line 78 of Script 7.4 should say …modify $parent->protected…. This change also applies to the fifth line of code under Step 8 on page 286 and to Figure 7.14 on that same page.May 14, 20077: Advanced Object-Oriented Programming292Line 112 of Script 7.5 should be **unset($dog, $cat, $pet);**April 2, 20118: Real-World Object-Oriented Programming321The message on line 42 should say “The file is not writable.” The corresponding code in Step 4 on page 324 is correct.October 25, 20088: Real-World Object-Oriented Programming332On line 149 of Script 8.4, the closing bold tag is missing its slash. This also applies to the code in Step 12 on page 339.January 19, 20098: Real-World Object-Oriented Programming340On line 7 of the first paragraph, the word “uses” should be “use”.May 24, 20099: Networking With PHP361The last line under Step 9 should refer to the check_url() function (singular).July 9, 20089: Networking With PHP367In the second tip, it should say …the host name associated with… (without the “of”).July 10, 200711: PHP’s Command-Line Interface435The first line of code under Step 3 should refer to $_SERVER

\['argv'\]\[1\]

. The corresponding script is correct.July 9, 200813: Ajax501In Script 13.4, the closing FORM and FIELDSET tags should be reversed on lines 33 and 34. This also affects Steps 4 and 5 on page 503.April 15, 200814: XML and PHP549In the eighth line in the left-hand column, it should refer to the xml_parser_create() function (as in the following line of code).April 15, 2008