Skip to content


“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.

ChapterPage #DescriptionDate Added
1: Introduction to PHP6The first word in the last paragraph in the sidebar should be “An” not “As”.February 18, 2008
1: Introduction to PHP14In 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 PHP28In 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 PHP30On line five, it should say …examples used so far….May 19, 2008
2: Programming with PHP34In the URL in the sidebar, there’s an extraneous space between “script.” and “php?”.February 18, 2008
2: Programming with PHP46The 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 PHP61The last line of code in the right-hand column should refer to “Primes” plural: {$numbers['Primes'][0]}.May 19, 2008
2: Programming with PHP65The last paragraph of the sidebar should refer to the $s2 variable, not $string2.February 18, 2008
3: Creating Dynamic Web Sites85In the paragraph under Step 2, the last sentence should start This variable will correlate….July 9, 2008
3: Creating Dynamic Web Sites89In 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 Sites89In 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 Sites89In 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 Sites98The last paragraph before the numbered steps should say there’s no way to pass $msg a value.April 15, 2008
4: Introduction to MySQL118There should not be a space between the hyphen and the letter “u” in the first bullet.May 19, 2008
5: Introduction to SQL137The SQL command in the second tip should end with WHERE last_name LIKE ‘_smith%’.February 18, 2008
5: Introduction to SQL146The last sentence of the first paragraph should read …MySQL functions in other types….July 9, 2008
5: Introduction to SQL147In Table 5.2, the Usage value for the second item should begin as “CONCAT_WS(…”.February 18, 2008
5: Introduction to SQL147In 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 MySQL170The > 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 MySQL172In the third sentence in the right-hand paragraph, “troutocity” should be “troutster”.October 25, 2008
6: Advanced SQL and MySQL179The last sentence in Step 2 should say that “An outer join is used…”.February 18, 2008
6: Advanced SQL and MySQL179The 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 MySQL182In the second paragraph in the right-hand column, “doesn’t not” should just be “does not”.October 25, 2008
6: Advanced SQL and MySQL185In the first block of example code in the right-hand column, the second colum1name should be column2name.February 14, 2009
6: Advanced SQL and MySQL191In 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 Debugging207The code in Step 1 omits the <h2>Testing Display Errors</h2> that is in the corresponding script.April 15, 2008
8: Using PHP with MySQL224In Script 8.1, the opening HEAD tag on line 3 erroneously has a quotation mark.July 9, 2008
8: Using PHP with MySQL236The first line of code in Step 9 should read mysqli_close($dbc);. The corresponding script is correct.April 15, 2008
8: Using PHP with MySQL236There’s an extraneous >> in the fourth line of code under step 10. The corresponding script is correct.May 24, 2009
8: Using PHP with MySQL237Not 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 MySQL252Line 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 Techniques266The header in Figure 9.3 should be “Delete a User”.May 19, 2008
9: Common Programming Techniques275The 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 Techniques280The 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 Techniques281On 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 Development309Line 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 Development311The 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 Development312The 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 Development324The second-to-last line of text should refer to the $name variable not the $name function.April 15, 2008
11: Cookies and Sessions357In the paragraph that begins Another change you…, the word “the” is repeated.April 15, 2008
11: Cookies and Sessions359Line 9 of Script 11.13 and the corresponding code in Step 5 needs one more closing parentheses.February 18, 2008
12: Security Methods364Line 59 of Script 12.1 has an extraneous character before the word “form”.May 25, 2010
12: Security Methods369On the fourth line of the sidebar, “even form a database” should be “even from a database”.October 25, 2008
12: Security Methods383In line 13 of the first paragraph, it should say “…view the data in its…”.January 19, 2009
13: Perl-compatible Regular Expressions392The two uses of print in Step 5 should actually be echo, to match the code in Script 13.1.November 1, 2009
Introduction393The first line of code under step 6 should be a closing curly brace, as found on line 29 of Script 13.1May 24, 2009
13: Perl-compatible Regular Expressions397There 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 Expressions411The 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 Sites430When creating or altering tables, you should declare the collation using the keyword COLLATE, not COLLATION.November 1, 2009
14: Making Universal Sites437In 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 Board478Line 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 Registration491Line 21 of Script 16.3 should end with a slash after www.example.com.July 9, 2008
16: Example–User Registration492Line 50 of Script 16.3 should begin echo ‘<div class=”error”>’.November 1, 2009
16: Example–User Registration509On 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 Registration510Line 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 Registration523The last sentence in the explanation for Step 7 should say “email address” instead of “password” (twice).October 25, 2008
16: Example–User Registration528The first sentence in the second paragraph of the sidebar should say that the footer file creates the links.November 1, 2009
17: Example–E-Commerce542Lines 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 Registration555The code in step 5 is actually a repetition of the last two lines of code in step 4.May 19, 2008
17: Example–E-Commerce580The heading at the top of the page should say “To create checkout.php:”.May 25, 2010
17: Example–E-Commerce582Line 55 of Script 17.10 should not be commented out. The code in the corresponding steps is correct.February 14, 2009

21 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Mike D says

    p 180 should be “maximum”, not “minimum”

  2. Larry says

    Thanks for your suggestion, but no. It should be “minimum”. MySQL guarantees that AT LEAST 16 indexes can be created on a table, regardless of the storage engine. The “maximum” number of indexes that can be created differs from one storage engine to the next.

    • Mike D says

      You are right, my mistake.

  3. Arny McCleary says

    There should be a br / after the / b to make the word “Comments” sit on top of the box.

    • Larry says

      No, actually, that’s not necessary. In Figure 2.5, the word “Comments” just appears on top of the textarea because the window has been resized.

      • Arny McCleary says

        Larry
        I have tried your suggestion but I can’t seem to get it to work.

        • Larry says

          Okay, how about trying my often-repeated suggestion of posting a message in the support forum so that I, and others, can assist?

  4. Elias Alves says

    Good Morning Sir. I have a problem on Script 8.7.
    Actually, I’ve checked this script many times, I already checked the step 4 “errata”. But anyway, I still have a problem! Looks like the script doesn´t match the password with the email, so I get the error ” The email address and password do not match those on file.” There is any new errata for this script?
    Thanks a lot!

    Regards from Brazil!

    • Larry says

      There are no new errors for this script. You’ll need to debug why your version is not working. If you need assistance, please use the support forums.

  5. Lesh says

    Hi Larry,

    I noticed a syntax erro on page 309, where the closing ‘ ; ‘ for the error class on line 10 is missing. Im not sure if this makes a difference to the rest of the code, but I thought to point it out. :)

    • Larry says

      You’re allowed to omit the semicolon for the last property in a CSS rule, but for consistency sake it should be in there. Thanks for pointing that out!

  6. Mike Weaver says

    Hi Larry,

    great book, I value reading each and every page!

    I believe the register.php listing is missing a mysqli_close($dbc) in chapter 8, p.233, script 8.3, line 85.

    The same applies to p.236, step 10, between the curly brackets of lines 14 and 15.

    It’s been corrected in the downloadable script version, though.

  7. Mike Weaver says

    Edit: sorry, my mistake. Please ignore my previous message. I was too quick on the draw and commented before reading p. 246. That’ll teach me to read the _entire_ chapter before posting.

    • Larry says

      No problem, Mike. And thanks for the nice words on the book!

  8. Rick says

    Hi Larry,

    I’m going through the painstaking process of making notations in the book re: errata, and I’m noticing something curious: In my copy of the book, I’m seeing some later “Date Added” errata already corrected, whereas some earlier “Date Added” errata still needing my notations from your list. I’m just wondering how that would happen. In other words, you might have some errata here dated from 2009 that’s actually CORRECT in my book, but something you date from 2008 that still needs correcting and hence requiring my notation on the respective page. Weird.

    Additionally — and I don’t know that you can answer this– but the back cover of my book says “FREE Online Edition with purchase of this book. Details on Last Page –>” I don’t see any such information inside on the last page(s). Any ideas?

    Thanks.

    • Larry says

      Hello Rick,

      Thanks for your questions. As for the errata, that can happen if either I or the publisher didn’t do a good job of managing the corrections. As for the free online edition, unfortunately I know nothing about this at all (I know people are buying books that say that, but I don’t know any of the details). You’ll have to contact the publisher to find out how to get your free electronic version.

      • Rick says

        Hi again,

        Thanks for answering on the errata issue, and thanks for actually POSTING errata! It could easily save a lot of head scratching and debug time. It would be great if all authors did that, but that again seems to be the kind of thing that sets you apart from many others.

        I figured you couldn’t answer about the free online thing. I’ve already put in a question to Peachpit about it and I’ll wait to see what they say.

        • Larry says

          Hey Rick. You’re quite welcome. I do what I can!

  9. Michael says

    Chapter 10, page 316, 317. Step 1 states the inclusion of the and then step 2 asks you to do it again. In the script itself (10.4) the script call is only done once.

  10. Jessica says

    Reading the Kindle edition, so I don’t have page numbers. In Step 5 for Script 8.7, the wrong code is inserted into the step. It’s actually identical to the code given in Step 6 (instead of what goes between steps 4 and 6). The corresponding script is still correct.

    • Larry says

      Okay. Sorry about that but thanks for letting me know.

If you need quick assistance with a question or problem related to one of my books, please use the support forums instead.

Some HTML is OK

or, reply to this post via trackback.