Errata for Learning PHP, MySQL, JavaScript, and CSS
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 xvIII, 270
4:th paragraph, 1:st paragraph |
Missing the Smarty chapetr that was in the first edition. There is however references to it in the second.
Note from the Author or Editor: Please disregard this mention. Smarty is not covered in the 2nd edition due to its decline in general popularity and implementation. Unfortunately that sentence was not caught during proofing.
|
Björn Larsson |
Oct 25, 2012 |
Apr 12, 2013 |
| Safari Books Online |
Apendix D
Date Functions, DATE_ADD, examples |
The Third line of example shows:
SELECT '2016-12-31 23:59:59' + INTERVAL 1 SECOND;
The results of this query show as:
2016-01-01 00:00:00
The Month and Day correctly updated but the year did not.
The results should show as:
2017-01-01 00:00:00
Note from the Author or Editor: Yes, on page 526, towards the bottom, the year should show itself updated to:
2017-01-01 00:00:00
|
Kevan Sheridan |
Feb 22, 2013 |
Apr 12, 2013 |
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page All of...
... the book |
Since mid April 2013 there is now a newer second edition of Learning PHP, MySQL, JavaScript and CSS, in which Chapter 2 has been fully rewritten to account for major changes that have been made to the Zend web server used throughout the book.
Also, all known errata up until April 12th are corrected in this new edition, so only any shown below submitted after this date will apply if you have this edition of the book.
|
 Robin Nixon
|
Apr 23, 2013 |
|
| Printed, PDF, ePub, Mobi, Safari Books Online, Other Digital Version |
Page 14
All of Chapter 2 |
With the release of Zend Server 6, Zend Server Community Edition (Zend CE) has been replaced with a new product called Zend Server Free Edition. It offers all the same functionality (and more), but installs and sets up slightly differently than the manner described in the book.
Therefore the tinyurl.com link given for the previous product, doesn't work, but you can get the new free server from the following URL:
http://zend.com/en/products/server/free-edition
Or the shorter:
http://tinyurl.com/zendfree
To take this development into account I have completely rewritten Chapter 2 around the new Zend Server Free Edition, and have uploaded a PDF of the chapter to the following URL:
http://lpmj.net/ch02.pdf
Please refer to this version of the chapter instead, particularly if you're using a Mac, as the MySQL install is now actually a little easier because there's less command line configuring to perform.
- Robin Nixon
|
 Robin Nixon
|
Mar 20, 2013 |
Apr 12, 2013 |
| Printed |
Page 17
1st paragraph |
Although stated elsewhere that installation of Zend may change during the lifetime of this edition the problem I have requires more than common sense. Zend 6 no longer gives the option to download phpMyAdmin. Is this a problem? It would be nice to have an explanation on how to download and configure it manually.
Note from the Author or Editor: A new Chapter two has been written to cover this, and is available at: http://lpmj.net/ch02.pdf
|
Anonymous |
Mar 05, 2013 |
Apr 12, 2013 |
| Printed |
Page 34
Top of page first sentence in first paragraph in relation to Figure 2-21 |
"As you can see from Figure 2-21, Editra highlights the syntax appropriately using ""colors"" to help clarify what's going on."
*This page, and all other pages in this book with PHP code examples probably should have been printed in color for Figure 2-21 and other examples. I am guessing that the original master proof of this was in color and when it went to print everything was flattened to Black & White (Greyscale).
I selected Minor Technical Mistake because it will not lead anyone wrong, but since it states as you can see from the colors and its all in greyscale I figured this should be shared with you.
If this is in color in the PDF version that I see from the drop down of product formats and since I already bought this book New at Amazon.com, if a copy of this PDF in color is available, that would be greatly appreciated to use side by side with this book as well as when working on code.
By the way I am currently at chapter 3 and greatly enjoying this book to learn PHP with MySQL, JavaScript, and CSS. Just received it today in the mail. I have other older programming books by O'Reilly and I feel they are the best books out there to learn from and use as references on projects.
Thanks for taking the time to read this and possibly correct to color printed figures in a 3rd edition on the book.
Note from the Author or Editor: in the next edition of the book I will note that you can see shades of grey in the figure in the printed version.
|
Dave Lembke |
Feb 14, 2013 |
Apr 12, 2013 |
| Printed |
Page 89
1st paragraph |
Describes the values of j$ being used for the calculation in the while loop on the previous page as "between 10 and -10" though the values used in the calculation are actually 9 to -10.
The vales going into the loop are 10 to -9 & are decremented by 1 before the calculation is performed.
Note from the Author or Editor: Example 4-36 should be replaced with the following:
<?php
$j = 11;
while ($j-- > -10)
{
if ($j == 0) continue;
echo "$j " . (10 / $j) . "<br />";
}
?>
|
Anonymous |
Mar 12, 2013 |
Apr 12, 2013 |
| Printed |
Page 105
Last sentence |
Reads, "Let's add a more few lines..." instead of "Let's add a few more lines...."
|
Robert McFarlane |
Nov 08, 2012 |
Apr 12, 2013 |
| PDF |
Page 108-109
Examples 5-14 and 5-15, inside User() and __construct() functions |
Parse error: syntax error, unexpected 'public' (T_PUBLIC)
Example 5-14. Creating a constructor method
<?php
class User
{
function User($param1, $param2)
{
// Constructor statements go here
public $username = "Guest";
}
}
?>
and
<?php
class User
{
function __construct($param1, $param2)
{
// Constructor statements go here
public $username = "Guest"; //
}
}
?>
Visibility should be declared in the scope of the class definition:
<?php
class User
{
public function User($param1, $param2)
{
// Constructor statements go here
$username = "Guest";
}
}
?>
and
<?php
class User
{
public function __construct($param1, $param2)
{
// Constructor statements go here
$username = "Guest"; //
}
}
?>
See PHP Manual>Classes and Objects>Visibility:
http://www.php.net/manual/en/language.oop5.visibility.php
P.S. Thank you VERY much for your hard work on LPMJC, 2nd Ed.! Absolutely luculent material; would absolutely recommend to anyone interested in dynamic web design looking for a great introductory text on the subject! Looking forward to 3rd Edition...? 8)
Note from the Author or Editor: Following are the corrected examples 5-14 and 15:
<?php // Example 5-14
class User
{
public function User($param1, $param2)
{
// Constructor statements go here
$username = "Guest";
}
}
?>
<?php // Example 5-15
class User
{
public function __construct($param1, $param2)
{
// Constructor statements go here
$username = "Guest"; //
}
}
?>
|
Louis R. Cost III |
Feb 12, 2013 |
Apr 12, 2013 |
| Printed |
Page 119
2nd Sentence |
reads, "--if you are have ever used a strongly..."
instead of "--if you have ever used a strongly..."
|
Robert McFarlane |
Nov 09, 2012 |
Apr 12, 2013 |
| Printed |
Page 126
Example 6-11 |
Creating a multidimensional numeric array for the chessboard example, there are two extra arrays. Should only be eight arrays not ten.
Note from the Author or Editor: By crikey, you're right, two lines crept into the middle there.
For this example to work correctly readers should delete two of the lines that look like this (or use the correct file in the downloadable archive of examples):
array(' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '),
|
wayne f |
Dec 03, 2012 |
Apr 12, 2013 |
| Printed |
Page 127
3rd paragraph |
"the uppercase letter Q, the eighth element down and the FIFTH along..." This should read: FOURTH.
Note from the Author or Editor: Yes, the word fifth should be fourth.
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 163
Paragraph beginning "So, to enter" halfway down |
In the two commands supplied the program name of mysql is missing. The correct commands are:
"C:\Program Files\Zend\MySQL51\bin\mysql" -u root
"C:\Program Files (x86)\Zend\MySQL51\bin\mysql" -u root
|
Robin Nixon |
Dec 01, 2012 |
Apr 12, 2013 |
| Printed |
Page 196
Example 8-28 |
"isbn VARCHAR(128),"
This should be 13 instead of 128.
Note from the Author or Editor: Since ISBN-13 numbers are only 13 characters long, for efficiency line 3 of Example 8-28 should be:
isbn VARCHAR(13),
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 217
1st paragraph (after figure) |
"It contains is..."
The word "all" should be added at the begining of the sentence: "All it contains is..."
Note from the Author or Editor: The paragraph under Figure 9-2 should read:
Table 9-12 is just such a table. It was extracted from Table 9-7, the Purchases table, but omits the purchase date information. It contains a copy of the ISBN number of every title sold, along with the customer number of each purchaser.
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 231
Example 10-2 |
When browsing the PHP documentation, I saw that the original MySQL extension was being deprecated in favor of the newer MySQLi extension. Aside from the object-oriented interface and some new features, how much does the new extension differ from the original?
This is a wonderful book. As a beginning web designer from Python and Java backgrounds, I've found it surprisingly simple to learn the basics of programming the Web 2.0. Thanks, Robin Nixon and O'Reilly!
Cheers,
Jordan
Note from the Author or Editor: Indeed the MySQLi extension is now recommended in preference to the old MySQL procedural extension. However the old method is deprecated but will continue to be supported for some considerable time.
The next edition of this book will follow the latest recommendations, regarding MySQLi.
|
Jordan Reuter |
Mar 25, 2013 |
Apr 12, 2013 |
| Printed |
Page 238
paragraph 2 |
"the first six lines"
This does not match the current version of the code in Example 10-8.
Note from the Author or Editor: The second paragraph under Figure 10-2 should read:
The first section of new code starts by using the isset function to check whether values for all the fields have been posted to the program. Upon such confirmation, each of the lines within the if statement calls the function get_post, which appears at the end of the program. This function has one small but critical job: fetching the input from the browser.
|
N. David Blech |
Mar 11, 2013 |
Apr 12, 2013 |
| Printed |
Page 239
under the heading: "Deleting a Record" |
"Having loaded up the various possible variables that could have been posted with any values that were passed, the program then checks whether the variable $_POST['delete'] has a value."
This description does not match the current version of the code in Example 10-8.
Note from the Author or Editor: The first paragraph in the section Deleting a Record should read:
Prior to checking whether new data has been posted, the program checks whether the variable $_POST['delete'] has a value. If so, the user has clicked on the DELETE RECORD button to erase a record. In this case, the value of $isbn will also have been posted.
|
N. David Blech |
Mar 11, 2013 |
Apr 12, 2013 |
| Printed |
Page 239
1st sentence of the 2nd to last paragraph |
"If $delete didn't contain the word "yes," the following else statement is executed."
This description does not match the current version of the code in Example 10-8. There is no else statement in the code, and the following if statement is entered regardless!
Note from the Author or Editor: The third paragraph under the heading Deleting a Record should read:
If $_POST['delete']) is not set and so there is no record to be deleted, $_POST['author']) and other posted values are checked. If they have all been given values then $query is set to an INSERT INTO command, followed by the five values to be inserted. The variable is then passed to mysql_query, which upon completion returns either TRUE or FALSE. If FALSE is returned, an error message is displayed.
|
N. David Blech |
Mar 11, 2013 |
Apr 12, 2013 |
| Printed |
Page 280
1st paragraph |
Reference to Example 10-31 - this doesn't exist - should be 10.22.
|
Jezw |
Sep 23, 2012 |
Apr 12, 2013 |
| Printed |
Page 284
under heading: "Ending a Session" |
"you can use the session_destroy function in association with the unset function, as in Example 12-7."
Example 12-7 does not use an unset function!
Note from the Author or Editor: The first paragraph under the Ending a Session heading should be:
When the time comes to end a session—usually when a user requests to log out from your site—you can use the session_destroy function, as in Example 12-7. This example provides a useful function for totally destroying a session, logging out a user, and unsetting all session variables.
|
N. David Blech |
Mar 19, 2013 |
Apr 12, 2013 |
| Printed |
Page 299
Last para - under 'Operators' heading |
'the following statement outputs 16: document.write(13+2)' is incorrect - it outputs 15.
|
Jezw |
Sep 23, 2012 |
Apr 12, 2013 |
| PDF |
Page 401
example 18.2 |
the style part of the example is not proper. it should be like:
<style>
div, span { border :1px solid black; }
div { background-color:yellow; }
span { background-color:cyan; }
</style>
Note from the Author or Editor: Yes, the style section of Example 18-2 is incorrect, and should be:
div,span { border :1px solid black; }
div { background-color:yellow; }
span { background-color:cyan; }
|
netrananda |
Oct 16, 2012 |
Apr 12, 2013 |
| Printed |
Page 401
Example 18-2 |
In both <div> objects inside <body> elements, there are missing the words "div" in the text that will be shown in the browser.
Note from the Author or Editor: For the sake of total clarity, in Example 18-2 of LPMJC Ed 2 you could replace the following line:
<div>This text is within a tag</div>
with this one:
<div>This text is within a div tag</div>
|
Cesar Tellez |
Jan 03, 2013 |
Apr 12, 2013 |
| Printed |
Page 416
last paragraph |
"The box model of an objectS"
should be: object
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 424
last line of Table 19-1 |
"Pseudoelements p::first-letter"
There should be only a single colon, not two.
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 429, 431, 435, 446
Examples 19-1, 19-2, 19-3, 19-4 |
"<DOCTYPE html>"
The exclamation point is missing. It should be: <!DOCTYPE html>
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 446-447
Example 19-4 & Figure 19-3 |
The title in the example ("Transitioning on hover") does not match the title at the top of the window in the figure ("CSS Rotate Example").
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 472
end of a code on the top of the page |
<br clear=left/> it should be <br clear='left'/>
Word left is without ' ' .
Note from the Author or Editor: While the following (at the end of example 21-1) will work just fine:
<br clear=left />
It is always better to place arguments in quotes, like this:
<br clear='left' />
|
Victor Sheyanov |
Feb 10, 2013 |
Apr 12, 2013 |
| Printed |
Page 504
Chapter 8 Answers, number 3 |
"GRANT PRIVILEGES ON..."
This should be: GRANT ALL ON...
Note from the Author or Editor: The answer to Q3 should be:
GRANT ALL ON newdatabase.* TO 'newuser' IDENTIFIED BY 'newpassword';
|
N. David Blech |
Mar 04, 2013 |
Apr 12, 2013 |
| Printed |
Page 510
End of list item 3 under 'Chapter 17 Answers' |
(See Tables 18-1 and 18-2) should be (See Tables 17-1 and 17-2)
|
Jezw |
Sep 29, 2012 |
Apr 12, 2013 |
|