“PHP 5 Advanced: Visual QuickPro Guide” 2nd Edition Errata

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:

Chapter Page # Description Date Added
1: Advanced PHP Techniques 10 The “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, 2007
1: Advanced PHP Techniques 15 On the second line of code under Step 9, the word
“its” should not be there. The corresponding
script is correct.
April 1, 2007
1: Advanced PHP Techniques 16 In 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, 2007
1: Advanced PHP Techniques 39 In the first step, add_task.php should refer to
Script 1.2, not Script 1.1.
2: Developing Web Applications 76 The comment on line 15 of Script 2.7 should state
that the cache interval is 6 hours, not 24.
May 19, 2008
3: Advanced Database Concepts 96 In the very last sentence, it should say One source of… (“One”
instead of “Once”).
May 21, 2007
3: Advanced Database Concepts 97 In 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, 2007
3: Advanced Database Concepts 105 If 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, 2008
3: Advanced Database Concepts 105 The 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, 2009
3: Advanced Database Concepts 111 Midway down the page, it should say RETURN data, not RETURNS. January 27, 2012
3: Advanced Database Concepts 115 The query in Step 10 has an extra – before
95.276050.
July 9, 2008
4: Security Techniques 125 The function referenced in item 10 should be
mysqli_real_escape_string().
May 19, 2008
4: Security Techniques 139 The comment on line 47 of Script 4.2 should read
Strip tags and encode
quotes:
.
August 30, 2007
4: Security Techniques 147 The $auth->start() line needs to be before the
opening HTML (line 42) if you’re not using output
buffering.
November 5, 2008
4: Security Techniques 159 The first line of code is missing an “i” in
“deinit”. It should read mcrypt_generic_deinit($m);.
January 26, 2008
5: E-Commerce Techniques 172 The first entry in Tables 5.4, 5.5, and 5.6 should
be of type TINYINT.
July 9, 2008
5: E-commerce Techniques 201 Line 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, 2007
5: E-Commerce Techniques 203 In the code under Step 8, the echo statement
should have …gw_id=$gw_id…. The
corresponding script is correct.
July 9, 2008
5: E-Commerce Techniques 207 Line 57 of Script 5.6 should be
if (mysqli_num_rows($r) >= 1)
{
This also applies to Step 6 on page 209.
November 5, 2008
5: E-Commerce Techniques 209 On 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, 2008
5: E-Commerce Techniques 216 On line 148 of Script 5.7, the bold tag isn’t
properly closed after “Total:”.
October 25, 2008
6: Basic Object-Oriented Programming 238 On 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, 2007
6: Basic Object-Oriented Programming 250 In 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, 2007
6: Basic Object-Oriented Programming 250 The third line of code in the second tip should
read
return ($this->width
* $this->width);
November 8, 2007
7: Advanced Object-Oriented Programming 264 In the last sentence of the third paragraph,
“reusability” is misspelled.
July 9, 2008
7: Advanced Object-Oriented Programming 265 In Figure 7.4, ‘attribute4’ of GrandchildClass
should not be grayed out as it does not appear in
ChildClass.
April 1, 2007
7: Advanced Object-Oriented Programming 267 The title value in the code for Step 1 (right-hand
column) should be “Pets”, not “Rectangle”. The
corresponding script is correct.
July 9, 2008
7: Advanced Object-Oriented Programming 283 Line 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, 2007
7: Advanced Object-Oriented Programming 292 Line 112 of Script 7.5 should be unset($dog, $cat, $pet); April 2, 2011
8: Real-World Object-Oriented Programming 321 The message on line 42 should say “The file is not
writable.” The corresponding code in Step 4 on
page 324 is correct.
October 25, 2008
8: Real-World Object-Oriented Programming 332 On 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, 2009
8: Real-World Object-Oriented Programming 340 On line 7 of the first paragraph, the word “uses”
should be “use”.
May 24, 2009
9: Networking With PHP 361 The last line under Step 9 should refer to the
check_url() function (singular).
July 9, 2008
9: Networking With PHP 367 In the second tip, it should say …the host name associated
with…
(without the “of”).
July 10, 2007
11: PHP’s Command-Line Interface 435 The first line of code under Step 3 should refer
to $_SERVER[‘argv’][1]. The corresponding script
is correct.
July 9, 2008
13: Ajax 501 In 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, 2008
14: XML and PHP 549 In 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