"Effortless E-Commerce with PHP and MySQL" 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.

Chapter Page # Description Date Added
2: Security Fundamentals 39 At the top of the page, it suggests that Figure 2.8 is on the next page when it’s actually on the same page. November 30, 2010
3: First Site: Structure and Design 53 In the last paragraph, the phrase “PDF scripts” in the fourth sentence should be “PDF files”. September 5, 2011
3: First Site: Structure and Design 55 In a stunning oversight, the escape_data() function defined never actually gets used! The intention was for that function to be called in lieu of mysqli_real_escape_string() in the site’s code. Ugh! January 3, 2011
3: First Site: Structure and Design 56 In Step 7, the order of the arguments to the mysqli_real_escape_string() function are in the wrong order. It should be:

return mysqli_real_escape_string
($dbc, trim ($data));
December 9, 2010
3: First Site: Structure and Design 65 In Step 7, the conditional should check if $this_page equals $v, not $k:

if ($this_page == $v)
echo ' class="selected"';
December 9, 2010
3: First Site: Structure and Design 70 Steps 3 and 4 should be reversed, so that the database connection is included prior to the header. This will become relevant in Chapter 4, when the login system is instituted. December 1, 2010
3: First Site: Structure and Design 71 The code in Step 10 should actually be

// $_SESSION['user_admin'] = true;
November 9, 2010
4: User Accounts 74 The backslash preceding the first line of code shouldn’t be there. November 29, 2010
4: User Accounts 87 In Step 9, the query should make use of the get_password_hash() function, not create_password_hash(). November 30, 2010
4: User Accounts 91 The first bit of code should include a file named login.inc.php. November 29, 2010
4: User Accounts 97 The prompt in Step 1 should say “text editor or IDE”. August 28, 2012
5: Managing Site Content 110 The label for attribute value in Step 14 should be title. January 11, 2011
5: Managing Site Content 132 Step 1 should say that the file being created is named view_pdf.php. January 3, 2011
6: Using PayPal 151 The prompt in Step 1 should say “PayPal Sandbox Test Site”. August 28, 2012
7: Second Site: Structure and Design 166 The first sentence under the caption “Product Tables” should begin “Six product-related tables…”. May 20, 2011
8: Creating a Catalog 211 The code at the top of the page, as part of Step 4, should have one more closing curly bracket, which completes the conditional begun in Step 3. July 19, 2011
8: Creating a Catalog 224 The two references to the get_sale_price() function should be just get_price(). December 22, 2010
9: Building a Shopping Cart 239 The conditional in the ternary operator in line 4 of the code under Step 12 needs to be updated per the explanation in this forum posting. June 23, 2011
9: Building a Shopping Cart 245 The conditional in the ternary operator in line 11 of the code needs to be updated per the explanation in this forum posting. June 23, 2011
9: Building a Shopping Cart 248 The get_shipping() function ought not to apply number formatting to the calculated shipping. As written, if the shipping is more than $999 (which, yes, is unlikely but still…), the query that inserts the order into the database, which includes the shipping, will fail because of the comma used to break up thousands. Ideally the function should return an unformatted number (or just formatted to two decimals), leaving the view script to format it as needed. August 28, 2011
10: Checking Out 253 Reports have it that Authorize.net has changed how they handle the creation of test accounts. According to one reader, now Authorize.net provides your API Login ID and Transaction Key online, after logging into the Authorize.net system (the information is not provided via email). June 23, 2011
10: Checking Out 289 In the code for Step 4, the single quotation marks are missing around the array index in $_POST[‘cc_number’]. April 2, 2011
10: Checking Out 290 The errors array referenced in Step 8 should be $billing_errors not $shipping_errors. October 23, 2010
10: Checking Out 298 The response variable referenced in Step 10 should be $response not $post_response. October 9, 2011
11: Site Administration 342 Step 4 should include $r = mysqli_query($dbc, $q); February 22, 2011
11: Site Administration 347 Under Step 11, all five TH elements are incorrectly closed. November 30, 2010