“PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide” (3rd 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:

Click on a column heading to sort the table by that column.

Chapter Page # Description Date Added
1: Introduction to PHP 6 The first word in the last paragraph in the sidebar should be “An” not “As”. February 18, 2008
1: Introduction to PHP 14 In the second bullet point, it should say that a variable’s name can contain a combination of letters, numbers, and the underscore. February 18, 2008
1: Introduction to PHP 28 In the code in Step 2, an apostrophe is missing. The code should be:
define (‘TODAY’, ‘August 28, 2007’);
The code in the corresponding script is correct.
January 26, 2008
1: Introduction to PHP 30 On line five, it should say …examples used so far…. May 19, 2008
2: Programming with PHP 34 In the URL in the sidebar, there’s an extraneous space between “script.” and “php?”. February 18, 2008
2: Programming with PHP 46 The CSS code is missing a semicolon after color: #C00. Although the semicolon is optional for the last item in a block, it should be there to be consistent. May 25, 2010
2: Programming with PHP 61 The last line of code in the right-hand column should refer to “Primes” plural: {$numbers[‘Primes’][0]}. May 19, 2008
2: Programming with PHP 65 The last paragraph of the sidebar should refer to the $s2 variable, not $string2. February 18, 2008
3: Creating Dynamic Web Sites 85 In the paragraph under Step 2, the last sentence should start This variable will correlate…. July 9, 2008
3: Creating Dynamic Web Sites 89 In the code at the end of the left-hand column, there’s an extra closing parentheses after ($gender == ‘F’). January 26, 2008
3: Creating Dynamic Web Sites 89 In the right-hand column, the second word of the second paragraph (not including the code) should be “here”, not “hear”. January 26, 2008
3: Creating Dynamic Web Sites 89 In the second block of example code in the right-hand column, the third line is missing a closing double quotation mark. It should be echo “<option value=\”$y\””; January 19, 2009
3: Creating Dynamic Web Sites 98 The last paragraph before the numbered steps should say there’s no way to pass $msg a value. April 15, 2008
4: Introduction to MySQL 118 There should not be a space between the hyphen and the letter “u” in the first bullet. May 19, 2008
5: Introduction to SQL 137 The SQL command in the second tip should end with WHERE last_name LIKE ‘_smith%’. February 18, 2008
5: Introduction to SQL 146 The last sentence of the first paragraph should read …MySQL functions in other types…. July 9, 2008
5: Introduction to SQL 147 In Table 5.2, the Usage value for the second item should begin as “CONCAT_WS(…”. February 18, 2008
5: Introduction to SQL 147 In Table 5.2, the Returns value for the last item should say that the string indexing begins at 1, not 0. February 18, 2008
6: Advanced SQL and MySQL 170 The > on the third line of the SQL command should not be there This should instead be an indentation of the previous line, indicating a continuation. May 24, 2009
6: Advanced SQL and MySQL 172 In the third sentence in the right-hand paragraph, “troutocity” should be “troutster”. October 25, 2008
6: Advanced SQL and MySQL 179 The last sentence in Step 2 should say that “An outer join is used…”. February 18, 2008
6: Advanced SQL and MySQL 179 The query in Step 2 should actually end GROUP BY (users.user_id). As written in the book, only one user without posts will be returned. The same change applies to Figure 6.24. November 5, 2008
6: Advanced SQL and MySQL 182 In the second paragraph in the right-hand column, “doesn’t not” should just be “does not”. October 25, 2008
6: Advanced SQL and MySQL 185 In the first block of example code in the right-hand column, the second colum1name should be column2name. February 14, 2009
6: Advanced SQL and MySQL 191 In the paragraph after the last bullet, it says that the next series of steps will demonstrate how to return Boolean FULLTEXT search results in order of relevance. That section got cut out of the book, unfortunately. May 25, 2010
7: Error Handling and Debugging 207 The code in Step 1 omits the <h2>Testing Display Errors</h2> that is in the corresponding script. April 15, 2008
8: Using PHP with MySQL 224 In Script 8.1, the opening HEAD tag on line 3 erroneously has a quotation mark. July 9, 2008
8: Using PHP with MySQL 236 The first line of code in Step 9 should read mysqli_close($dbc);. The corresponding script is correct. April 15, 2008
8: Using PHP with MySQL 236 There’s an extraneous >> in the fourth line of code under step 10. The corresponding script is correct. May 24, 2009
8: Using PHP with MySQL 237 Not a huge deal, but in a couple of places, the email input in the HTML form has a maxlength of 80, whereas the defined column in the database has a maximum length of 60. November 1, 2009
8: Using PHP with MySQL 252 Line 18 of Script 8.7 should begin with $e = …. The corresponding code in Step 4 on page 253 is correct. January 26, 2008
9: Common Programming Techniques 266 The header in Figure 9.3 should be “Delete a User”. May 19, 2008
9: Common Programming Techniques 275 The first line of code under Step 12 should refer to MYSQLI_NUM (all in uppercase). The corresponding script is correct. April 15, 2008
9: Common Programming Techniques 280 The comment in the last line of code in Step 5 should say that it’s the end of the “p” IF. The corresponding code in the script is correct. February 14, 2009
9: Common Programming Techniques 281 On lines 9 and 10 of the first paragraph under step 6, it should say The second page would show records 10 through 19; the third, 20 through 29; and so forth. May 19, 2008
10: Web Application Development 309 Line 24 of Script 10.3 inadvertently include ‘image/jpeg’ twice. This also applies to the code in Step 3 on page 310. April 15, 2008
10: Web Application Development 311 The echo statement in Step 5 should just read echo ‘<p class=”error”>Please upload a JPEG or PNG image.</p>’;
. The code in the corresponding script is correct.
April 15, 2008
10: Web Application Development 312 The MAX_FILE_SIZE hidden input in Script 10.3 on line 85 should end with a space and a slash to be XHTML compliant. This also applies to the code in Step 10 on page 314. October 25, 2008
10: Web Application Development 324 The second-to-last line of text should refer to the $name variable not the $name function. April 15, 2008
11: Cookies and Sessions 357 In the paragraph that begins Another change you…, the word “the” is repeated. April 15, 2008
11: Cookies and Sessions 359 Line 9 of Script 11.13 and the corresponding code in Step 5 needs one more closing parentheses. February 18, 2008
12: Security Methods 364 Line 59 of Script 12.1 has an extraneous character before the word “form”. May 25, 2010
12: Security Methods 369 On the fourth line of the sidebar, “even form a database” should be “even from a database”. October 25, 2008
12: Security Methods 383 In line 13 of the first paragraph, it should say “…view the data in its…”. January 19, 2009
13: Perl-compatible Regular Expressions 392 The two uses of print in Step 5 should actually be echo, to match the code in Script 13.1. November 1, 2009
Introduction 393 The first line of code under step 6 should be a closing curly brace, as found on line 29 of Script 13.1 May 24, 2009
13: Perl-compatible Regular Expressions 397 There should not be a space between the comma and the y in the fifth entry of Table 13.2. November 1, 2009
13: Perl-compatible Regular Expressions 411 The second sentence in the caption to Figure 13.24 does not apply to the image and should be deleted. November 1, 2009
14: Making Universal Sites 430 When creating or altering tables, you should declare the collation using the keyword COLLATE, not COLLATION. November 1, 2009
14: Making Universal Sites 437 In the sidebar, the three references to the set_locale() function should be setlocale(), without an underscore. The same goes for ucwords(), in the right-hand column. October 25, 2008
15: Example–Message Board 478 Line 41 of Script 15.7 should refer to $_SESSION[‘lid’] instead of $lid. The change also applies to the corresponding code in Step 6 on page 479. November 1, 2009
16: Example–User Registration 491 Line 21 of Script 16.3 should end with a slash after www.example.com. July 9, 2008
16: Example–User Registration 492 Line 50 of Script 16.3 should begin echo ‘<div class=”error”>’. November 1, 2009
16: Example–User Registration 509 On line 13 of Script 16.7, and on line 8 of the code in Step 2, there’s a closing parentheses missing. The correct line should be
if (isset($_GET[‘y’]) && (strlen($_GET[‘y’]) == 32) ) {
January 26, 2008
16: Example–User Registration 510 Line 29 of Script 16.7 and the corresponding code in Step 4 on page 511 should not have the closing </font> tag. October 25, 2008
16: Example–User Registration 523 The last sentence in the explanation for Step 7 should say “email address” instead of “password” (twice). October 25, 2008
16: Example–User Registration 528 The first sentence in the second paragraph of the sidebar should say that the footer file creates the links. November 1, 2009
17: Example–E-Commerce 542 Lines 163 and 182 of Script 17.1, and the corresponding code under Step 16 on page 549 and Step 18 on page 551, are missing the space before /> to make the page XHTML compliant. November 1, 2009
16: Example–User Registration 555 The code in step 5 is actually a repetition of the last two lines of code in step 4. May 19, 2008
17: Example–E-Commerce 580 The heading at the top of the page should say “To create checkout.php:”. May 25, 2010
17: Example–E-Commerce 582 Line 55 of Script 17.10 should not be commented out. The code in the corresponding steps is correct. February 14, 2009