The errata list is a list of errors and their corrections that were found after the product was released.
The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.
Version |
Location |
Description |
Submitted by |
Date Submitted |
Printed |
Page 47
3rd paragraph below the table 3-4 in 5th edition of the book |
<?php
function file_get_contens($should_fail = false)
{
if ($should_fail) {
return false;
}
return "file contents";
}
function die1($value) {
echo $value. "\n";
}
// book states that: "|| cannot be used to force a second statement to execute if the first fails."
// this is wrong, as shown in examples below.
// the actual difference is || has higher precedence than assignment operator and "or" has lower precedence.
// if you do "or", the result of file contents is frsit assigned to $html1 and then second statement is executed if $html1 is false.
// if you do "||" the result of whole expression (file_get_contens() || die1("cannot do");) is assigned to $html2
echo "start success". "\n";
$html1 = file_get_contens() or die1("cannot do");
$html2 = file_get_contens() || die1("cannot do");
echo "file_get_contens succeeds. Value of html1. ".$html1. "\n";
echo "file_get_contens succeeds. Value of html2. ".$html2. "\n";
echo "start failure". "\n";
$html1 = file_get_contens(true) or die1("cannot do");
$html2 = file_get_contens(true) || die1("cannot do");
echo "file_get_contens fails. Value of html1. ".$html1. "\n";
echo "file_get_contens fails. Value of html2. ".$html2. "\n";
?>
|
Vidhya Priyadharshnee Palaniswamy Gnanam |
Feb 04, 2024 |
Printed |
Page 296
exampe 12-4, 4th edition |
in the 4th edition, in example 12-4, it should be
$connection = new mysqli($hn, $un, $pw, $db);
in otherwords, it should be like in 4th edition, example 12-3
$connection = new new mysqli($hn, $un, $pw, $db);
assuming of course that login.php has these variables set up ($hn, $un, $pw, $db)
otherwise, if example 12-4 is left as is currently, the book's reader cannot login. It'll say something like 'database not found'
|
Anonymous |
Aug 25, 2016 |
Printed |
Page 275
Example 12-4 |
The combination of the smartytest.tpl file (Example 12-4) and Example 12-3 does not work as intended: deleting files does not work.
Since deleting (in Example 12.3) is only done after a test that will always fail, the file is never deleted.
The test fails because isset($_POST['author']) will never evaluate to TRUE.
This also holds for the other tests with 'title', 'category', etc., (but not for 'isbn').
The reason why this is the case is because, in Example 12-4, the only things that are posted are 'delete' and 'isbn'.
the part between the section tags should be changed to:
{section name=row loop=$results}
<form action="smartytest.php" method="post">
<input type="hidden" name="delete" value="yes">
<input type="hidden" name="author" value="{$results[row].author}">
<input type="hidden" name="title" value="{$results[row].title}">
<input type="hidden" name="category" value="{$results[row].category}">
<input type="hidden" name="year" value="{$results[row].year}">
<input type="hidden" name="isbn" value="{$results[row].isbn}">
<pre>
Author {$results[row].author}
Title {$results[row].title}
Category {$results[row].category}
Year {$results[row].year}
ISBN {$results[row].isbn}
<input type="submit" value="DELETE RECORD"></pre>
</form>
{/section}
I'm not knowledgeable enough about Smarty to say it is a bug in the current version, but I would be surprised.
|
Arthur Sauer |
Jan 18, 2016 |
Printed |
Page 255
Pgm listing at top of page |
$subresult = $conn->query($query);
should be
$subresult = $conn->query($subquery);
|
Anonymous |
Jul 08, 2015 |
Printed |
Page 107
Figure 5-3 Illustration |
Figure 5-3 is said to depict a jukebox to illustrate the OOP concepts. However, the image provided is the image for figure 5-2 with the thread attached the nametag that's tucked into the matchbox.
|
Anonymous |
Mar 13, 2015 |
Printed |
Page 163
2nd paragraph and on |
The command for starting MySQL from a command prompt in Windows OMITS the necessary "mysql" from the lines
C:Program Files\Zend\MySQL51\bin
and
C:Program Files (x86)\Zend\MySQL51bin
also the lines
"C:\Program Files\Zend\MySQL\bin" -u root
and
"C:\Program Files (x86)\Zend\MySQL\bin" -u root
|
Alan Cameron |
Jul 05, 2014 |
ePub |
Page 171
Table 4-2 |
!= is listed as an Assignment Operator. Should most likely to be |=
|
Brett Santore |
Dec 04, 2013 |