"PHP and MySQL for Dynamic Web Sites: 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
Introduction 0 On page xi, in the third paragraph in the left column, on line 6, it should be was designed to write… (there’s an extra “to”). March 14, 2006
1: Introduction to PHP 15 In the first sentence of the right-hand column, it says two backslashes. Those are just normal slashes. August 11, 2005
1: Introduction to PHP 23 Midway through the right column, it should say so that a comma and a space are added to the mix. August 11, 2005
1: Introduction to PHP 23 The third line of code in the right column should be $address = $city . $state; August 11, 2005
1: Introduction to PHP 33 On line 16 of Script 1.11, the comment should say “Calculate the total.” August 11, 2005
2: Programming with PHP 38 The closing </html> tag is missing in Script 2.1. August 11, 2005
2: Programming with PHP 42 The code in Step 4 should include the closing PHP tag, see line 22 of Script 2.2. January 30, 2007
2: Programming with PHP 53 On line 19 of Script 2.5, the comment erroneously suggests that it may combat Magic Quotes. This does not occur. The comment should just be “Validate the email.” October 2, 2006
2: Programming with PHP 58 At the end of the first paragraph, it should be you cannot simply code:. October 24, 2005
2: Programming with PHP 67 The closing </html> tag is missing in Script 2.8. August 11, 2005
2: Programming with PHP 71 On the last line in the right column, it should be “Thur”, not “Thurs”. August 16, 2005
2: Programming with PHP 78 The instructions for Step 3 and for Step 4 on page 79 should refer to rewriting the “for” loop, not the “foreach” loop. May 14, 2007
3: Creating Dynamic Web Sites 83 The caption to the steps should be “To include multiple files:”. August 11, 2005
3: Creating Dynamic Web Sites 86 ‘The closing </html> tag is missing in Script 3.3.’, August 11, 2005
3: Creating Dynamic Web Sites 89 In Step 12, it inadvertently refers to “layout.ccs”. This should obviously be “layout.css”. July 12, 2005
3: Creating Dynamic Web Sites 114 The third example of the date() function should actually read echo ‘Today is ‘ . date(‘D’); December 10, 2006
4: Introduction to SQL and MySQL 134 In the first bullet under Step 2, there should not be a space between – and u. April 15, 2008
4: Introduction to SQL an 148 In the code for the second tip, it should obviously say SELECT * FROM users WHERE user_name LIKE ‘_smith%’ May 23, 2006
4: Introduction to SQL and MySQL 159 The SQL query under Step 1 should be SELECT CONCAT(first_name, ‘ ‘, last_name) FROM users; to match the image in Figure 4.33. October 24, 2005
4: Introduction to SQL and MySQL 159 The SQL query in Step 2 should read “SELECT CONCAT(first_name, ‘ ‘, last_name) AS Name FROM users;” to match Figure 4.34. October 2, 2006
4: Introduction to SQL and MySQL 160 In the final sentence of the explanation of Step 3, it should say that the last name of the first row is returned. October 24, 2005
5: Advanced SQL and MySQL 180 In Table 5.6 there is an inadvertent space in the “url_associations” table name in five of the listings. July 12, 2005
5: Advanced SQL and MySQL 185 In the description of Step 3, on the second line, it inadvertently refers to title_id and type_id. These should be url_id and url_category_id. August 11, 2005
5: Advanced SQL and MySQL 187 In the last paragraph, it should read “introduced in Chapter 4”. August 23, 2006
5: Advanced SQL and MySQL 188 In Step 2, towards the end of the explanation, it should say In simplest terms, what is returned by this query is every record from the url_associations table… January 30, 2007
5: Advanced SQL and MySQL 189 Step 3, in the explanation, it should say Whereas that join returned only the URL and category for records in the url_associations table… January 30, 2007
5: Advanced SQL and MySQL 190 The instructions for Step 1 should read “Select all of the URLs that…”. October 2, 2006
5: Advanced SQL and MySQL 195 In the sixth Tip, on the second line, an “n” is missing in columnname. August 11, 2005
5: Advanced SQL and MySQL 195 In the last line of the last Tip, it should say what indexes are involved in a query. August 11, 2005
5: Advanced SQL and MySQL 196 Step 1 mistakenly refers to the “contents” database. The actual database name is “content”. January 30, 2007
5: Advanced SQL and MySQL 196 In the caption to Figure 5.30, the command should be SHOW TABLE STATUS as in the figure and in Step 2. July 10, 2007
5: Advanced SQL and MySQL 197 The second tip mistakenly refers to the “contents” database. The actual database name is “content”. January 30, 2007
5: Advanced SQL and MySQL 199 In Step 1, it should say …select the content database. (without the “s”). November 7, 2005
5: Advanced SQL and MySQL 199 In the last sentence under Step 3, it should end with makes the results easier to view. December 10, 2006
5: Advanced SQL and MySQL 207 On the seventh line of the third paragraph, it should say that The type is very important, reflecting…. August 11, 2005
6: Error Handling and Debugging 221 In the sidebar, the include line has the closing single quotation mark in the wrong place. It should be @include(‘config.inc.php’); August 11, 2005
7: Using PHP with MySQL 246 The code closing the MySQL connection in Step 9 on page 246 and on line 71 of Script 7.3 on page 247 will never actually be executed. Although this code isn’t required, it should technically come before both lines 60 and 67. December 12, 2005
7: Using PHP with MySQL 254 At the end of the second paragraph, it should say I discussed this in some detail…. October 6, 2005
7: Using PHP with MySQL 266 The caption to Script 7.8 calls the script “change_password.php”. It’s actually just “password.php”. August 30, 2007
7: Using PHP with MySQL 267 Line 55 of Script 7.8, and the corresponding code in Step 5 on page 268, should read if ($num == 1) { // Match was made.. March 11, 2007
7: Using PHP with MySQL 271 In Script 7.8 on line 109 and in the corresponding code in Step 10, the value of the submit button should be “Change My Password”, not “Register”. This would change the images on page 272 as well. August 11, 2005
8: Web Application Development 279 At the bottom of the page, it says that Script 8.2 continues on page 285. It actually continues on page 281. June 20, 2006
8: Web Application Development 298 In the last line of code in Step 4, it should say $num_records = $row[0];. The corresponding script is correct. August 16, 2005
8: Web Application Development 298 The query in Step 4 does not require the ORDER BY clause. This also applies to line 26 of Script 8.5 and to Script 8.6. October 26, 2009
8: Web Application Development 308 In Script 8.6 on line 89, it should be $sort = ‘drd’;. This also applies in the code for Step 6 on page 309. July 12, 2005
8: Web Application Development 308 At the end of Step 5, the closing single quotation mark is missing in the default case. The code in the corresponding script is correct. October 24, 2005
8: Web Application Development 309 In the third line of code under Step 6, there should be a single straight quotation mark at the end of the string and the default order by should be DESC. That line should read
$order_by = ‘registration_date DESC’; The DESC ORDER BY applies to line 88 of Script 8.6 on page 308.
September 27, 2005
9: Cookies and Sessions 327 At the bottom of the script, it should say script continues on page 329. April 15, 2008
9: Cookies and Sessions 333 In the first tip, it should say that if the submitted email address and password do not match…”. July 24, 2006
9: Cookies and Sessions 345 On line 8 of the sidebar, it should say you can refer to it using… (“it” instead of “is”). May 21, 2007
9: Cookies and Sessions 363 In the third paragraph of the sidebar, “session_gc_maxlifetime” should be session.gc_maxlifetime. July 24, 2006
10: Web Application Security 392 Towards the end of the second paragraph, it should read “and is_array() is great for…” (there’s an extra “a”). October 2, 2006
10: Web Application Security 395 Script 10.5, the corresponding steps, and the corresponding figures, all state that the tax is option when, in fact, it is not. December 10, 2006
11: Extended Topics 430 At the bottom of the page it says “continues on pge 438”. It should actually read “continues on page 432”. October 2, 2006
11: Extended Topics 433 In the third Tip, the parenthetical should read “so C:\\ or C:/ rather than C:\” (the colon is in the wrong place after the second ‘C’). August 23, 2006
11: Extended Topics 460 In the third line of the paragraph following Step 8, it should say The ROLLBACK command…. November 8, 2007
13: Example–User Registration 535 Towards the end of the last paragraph, the error handler function is misspelled. It should be my_error_handler(). January 26, 2008
13: Example–User Registration 539 Script 13.5 and the images on page 540 should say that this is a “QuickPro” guide, not a “QuickStart”. October 25, 2008
14: Example–E-Commerce 588 Line 36 of Script 14.2–
$i = $_FILES[‘image’][‘name’];
–should actually go on line 31. This also applies to the code in Step 4.
November 5, 2008
14: Example–E-Commerce 604 In the first line of code under Step 1, it should say that this is Script 14.6. April 15, 2008
Ap A: Installation 637 In the third line of explanation for Step 3, it should say When it comes time to enter the server… (“enter” instead of “entire”). January 19, 2006
Ap A: Installation 647 The GRANT statement in Step 3 is missing the word “ON” before “sitename”. It should begin GRANT SELECT, INSERT, UPDATE, DELETE ON sitename.* TO ‘username’@’localhost’ IDENTIFIED BY ‘password’;. The statement in the corresponding figure is correct. July 12, 2005
Ap A: Installation 648 In Step 2, the line secretly appended .txt should be secretly append .txt. November 9, 2005
Ap A: Installation 648 In Step 4, it should say where username is your short username (without the tilde). April 15, 2008