Topic: PHP/MySQL

Beginning PHP5 (0764557831) cover image

Beginning PHP5

Dave W. Mercer, Allan Kent, Steven D. Nowicki, David Mercer, Dan Squier, Wankyu Choi with Heow Eide-Goodman, Ed Lecky-Thompson, Clark Morgan
ISBN: 978-0-7645-5783-5
Paperback
888 pages
July 2004
This is a Print-on-Demand title. It will be printed specifically to fill your order. Please allow an additional 2-3 days delivery time. The book is not returnable.
Paperback Version: US $44.99 Add to Cart

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

</tr> <tr> <td width="57%"><font face="Arial, Helvetica, sans-serif" size="-1">Get a random number - Using rand()</font></td>


The first error on page 56 can be confirmed by the downloadable source code and the second error can be confirmed by Figure 2-3 on page 57. </tr> <tr> <td width="57%"><font face="Arial, Helvetica, sans-serif" size="-1">Get the square root - Using sqrt()</font></td>
ChapterPageDetailsDatePrint Run
Errata Download
The content for this title has been posted and may be accessed via http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764557831.html
3/21/06
44 Error in Code
In the Converting Data Types in PHP Section, the code reads:
"echo " The varaivle is now...""

It should read:
"echo " The variable is now...""
05/10/2006
49 Typo
Using the strops() function :
&qout;a

should be:
&qout;o
05/14/07
55 Error in Code
The answer to total2= $first_number *= $second_number should be 600 not 1500.
04/10/2008
56 Errors in Code
The first error in the code on page 56 is the following:


Code Reads:

/font></td> </tr> <tr> <td width="57%"><font face="Arial, Helvetica, sans-serif" size="-1">Get the value of PI - Using pi()</font></td>

It should read:
</font></td> </tr> <tr> <td width="57%"><font face="Arial, Helvetica, sans-serif" size="-1">Get the value of PI - Using pi()</font></td>

The second error in the code on page 56 is the following:


The code reads:

</font></td> </tr> <tr> <td width="57%"><font face="Arial, Helvetica, sans-serif" size="-1">Get a random vnumber - Using rand()</font></td>
It should read:

</font>
05/10/2006
57 Error in Code
The code reads:

/font></td> </tr> <tr> <td width="57%"><font face="Arial, Helvetica, sans-serif" size="-1">Get the square root - Using sqrt()</font></td>

It should read:

</font>
05/10/2006
69 Error in Code
In the Try it Out section, the code in the book reads:

<?php
echo "<PRE>";
print_($GLOBALS);
echo "</pre>";
?>

However, it should read:

<?php
echo "<PRE>";
print_r($GLOBALS);
echo "</pre>";
?>
05/10/2006
133 Errors in Text
Line Number 48 reads:
if ($-POST[type_sel] {

should read:
if ($_POST[type_sel] {


AND


Line Number 53 reads:
if ($_POST[size-sel] {

should read:
if ($_POST[size_sel] {
05/02/2006
508 Constraint Clauses
This is a minor point regarding the MYSQL listing in chapter 13 for creating new tables associated with the example application. The creation of the entityaddress, entitymail, entityphone, and entityemployee contain CONSTRAINT clauses.

My understanding is that by default MySQL uses the MyISAM storage engine for tables. This storage engine does not support foreign key constaints like the ones specified in the listings.

To get the constraints enforces a table type of innoDB would need to be specified using following syntax:
CREATE TABLE customers (a INT, b CHAR (20), INDEX (a)) ENGINE=InnoDB;
or
CREATE TABLE customers (a INT, b CHAR (20), INDEX (a)) TYPE=InnoDB;

The constraint statement will not cause an error if entered. MySQL will parser the statements, but they will be ignored.
6/1/05
524 Syntax Errors
Syntax error in the constraint statements:

CONSTRAINT fk_entityemail_entityid
FOREIGN KEY (entityid) REFERENCES entity(entityid)

This statement is trying to create a foreign key constraint to the table created on page 508, but this has been created with a table name of "entities" not "entity", hence the statement should read:

CONSTRAINT fk_entityemail_entityid
FOREIGN KEY (entityid) REFERENCES entities(entityid)
6/1/05