Learning PHP, MySQL & JavaScript

Errata for Learning PHP, MySQL & JavaScript

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed
Page 243
Example 10-6

Referring to this code, in example 10-6 if (isset($_POST['author']) && isset($_POST['title']) && isset($_POST['category']) && isset($_POST['year']) && isset($_POST['isbn'])) pg. 245 states "The first section of new code [shown above] starts by using the isset function to check whether values for all the fields have been posted to the program. " isset returns true when no value is submitted in the form. isset only triggers when the value being checked is NULL. To fix it, you can replace all the isset tests with !empty (not empty) so you can actually check whether values for all the fields have been filled in by the user before the user tries to write empty, garbage data to the database. The isset check, as it is currently written, checks for nothing at all, as far as I can tell.

Kyle Benjamin  Jul 23, 2019  Aug 09, 2019
Printed
Page 26
First paragraph under "Installing AMPPS on macOS"

URL given for downloading AMPPS is apachefriends.org (which is URL for XAMPP not AMPPS).

Note from the Author or Editor:
Correct the URL should be: https://www.ampps.com

Anonymous  Jul 14, 2019  Aug 09, 2019
PDF
Page 198
2nd paragraph

3rd line: "Because and is a stopword" 'and' is stopword for MyISAM search index. But we are (as instructed in the book) using here InnoDB seach engine where 'and' is not a stopword. Check: https://dev.mysql.com/doc/refman/8.0/en/fulltext-stopwords.html#fulltext-stopwords-stopwords-for-innodb-search-indexes

Note from the Author or Editor:
Replace the sentence: Because and is a stopword, MySQL will ignore it and the query will always produce an empty set - no matter what is stored in the columns With: If you are using the MyISAM storage engine, then because and is a stopword in that engine, MySQL will ignore it and the query will always produce an empty set - no matter what is stored in the column. Otherwise, if you are using InnoDB and is an allowed word.

Tomi Halonen  Jul 02, 2019  Aug 09, 2019
Printed
Page 60
Example 3-18

the statement is incorrect static $int = 1+2; //Disallowed (will produce a parse error) As per PHP 5.6 static $int = 1+2; // correct (as of PHP 5.6) reference: https://www.php.net/manual/en/language.variables.scope.php Thanks Luca Sabato

Note from the Author or Editor:
Correct. Please replace: static $int = 1+2; //Disallowed (will produce a parse error) With: static $int = 1+2; // correct (as of PHP 5.6)

Luca Sabato  May 30, 2019  Aug 09, 2019
Printed
Page 90
2nd paragraph

variable $j should be set to 11 in order to satisfy "For all values of $j between 10 and -10..." (as $j is decremented before the echo statement runs).

Steve Benson  Mar 16, 2019  Aug 09, 2019
Printed
Page 269
Example file: example11-2.php

Not sure if intentional or an error: Line 12 in the example file (example11-2.php): form method="post" action="formtest.php" Should be: form method="post" action="formtest2.php" formtest2.php - matches the example printed in the book

Note from the Author or Editor:
Fixed in the downloadable examples to match the book.

Anonymous  Feb 21, 2019  Aug 09, 2019
Printed
Page 28
Under the 'Installing LAMP on Linux' Section

The text tells you to download the linux version of AMPPS from apachefreinds.org. This is wrong as this the the home of XAMPP. I assume this was used in the previous addition and it was missed during checking for the new version.

Note from the Author or Editor:
Correct. The URL is: https://www.ampps.com

Peter Jones  Dec 28, 2018  Aug 09, 2019
Safari Books Online
Ch18
15th paragraph

Under the section "Using Classes" Problem: Missing apostrophe or sentence needs rewriting in the first sentence. The first sentence: The value of an id element must be unique within the web page, because that what lets it serve as an identifier. === Should be: The value of an id element must be unique within the web page, because that's what lets it serve as an identifier. ==== (I've underlines it, if you look at the text in a fixed width font.)

Note from the Author or Editor:
This was fixed during production.

Anonymous  Jan 08, 2018  May 08, 2018
Safari Books Online
Ch17
Example 17-2. urlpost.html

Coded HTML does not work at present Currently text says: params = "news.com" It needs to say: params = "url=news.com" The text describing the example refers to setting params to the name/value pair that will be posted to the PHP that responds to it.

Note from the Author or Editor:
This was fixed during production.

Anonymous  Jan 07, 2018  May 08, 2018