Learning PHP & MySQL, Second Edition by Michele Davis, Jon Phillips The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated April 16, 2008. {10} 5th paragraph; The line ending "...where it was referenced as user_admin.css" is incorrect. The name of the style sheet used in the previous example was example.css {11} 3rd Paragraph; It reads: (Instead of bolditalic, you should close the code like this: .) This is contradicted by the last sentence: So, if you open a bold and then italic, you should close the italic before you close the bold. So the correct manner would be: bolditalic [16] 4th paragraph (step 1); The position where to download, the name and the FORMAT of the file to download is not updated. Apache server now is a zip file and not a MSI installer as stated in the book. The procedure is changed. [25] Section entitled Enabling PHP on Mac OS X; I just wanted to note that with the release of OS X 10.5 (Leopard), that the location of httpd.conf has changed and thus enabling PHP on 10.5 systems will not work with the directions as provided. For that reason alone, I'm marking this as a serious technical mistake, even though it's still accurate for 10.4 and earlier systems. The new location with 10.5 is in /etc/apache2/httpd.conf. [32] Installing MySQL Connector section; Although this is the latest edition (2007), the web address given http://dev.mysql.com/downloads/ connector/php/ does not exist. I appreciate that technology always changes and a book can onlyy br right at time of printing! The page now seems to be http://dev.mysql.com/downloads/connector/php-mysqlnd/ However this seems to use a different way of connecting to PHP. Any advice would be welcome, as any purchaser of the book will have the same problem. {33} 1st paragraph starts with "6. Verify that ..." (This is in Chapter 2: Installation); php_mysql.dll should be php_mysli.dll [36] 1st paragraph; The sentence "Graphical FTP clients make using FTP much easier, FTP Voyager, available from http://sourceforge.net/ filezilla/, is one FTP client you can use to upload files to your ISP." is incorrectly referring to "FTP Voyager" available from http://www.ftpvoyager.com/ (this is a trialware product good for 30 days). I found this information on their download page: "This copy of FTP Voyager will no longer function after the 30-day trial period has expired. In order to continue using FTP Voyager after the trial period, you will need to purchase a Registration ID which will make the program fully functional again." The name of the open source FTP client at the URL listed on page 36 is "FileZilla". Figure 2-31 on page 37 and Figure 2-32 on page 38 refer to FTP Voyager also and will need to be changed to refer to screen from FileZilla. (52) Top bullet item, also paragraph under Example 3-16; Description says to use a slash but the example shows a backslash. / = slash \ = backslash Example 3-16 escapes quotations by placing a slash in front of each one (\"). The slash tells... should be Example 3-16 escapes quotations by placing a backslash in front of each one (\"). The backslash tells... (53) Last paragraph from the bottom.; Second sentence, $!result should be !$result "If $result is true, then $!result is false, and vice versa." ...should read: "If $result is true, then !$result is false, and vice versa." (60) 5th line of Example 3-25; echo "Value afterwords: ".$test; should be echo "Value afterwards: ".$test; (65) First line after paragraph heading "Number of operands"; Different operands take different numbers of operands. should be: Different operators take different numbers of operands. (69) 1st; 5+3-2=8 {82} about the middle of the page; ..."Of course, there may be times when you donīt want to just skip".. should read as: ..."Of course, there may be times when you want to just skip".. (91) Example 5-6; There are one to many "{" in Example 5-6 Deleting the first or second "{" corrects the code. {113} 3 paragraph; "The assort() function works like sort".... should read "The asort() function works like sort".... (117) Last line; expand($array,EXTR_PREFIX_ALL,"the_prefix"); should be: extract($array,EXTR_PREFIX_ALL,"the_prefix"); (130) function validate_form; Example 7-30 gives wrong code for validating 'floating point number': // price must be a valid floating point number and // more than 0 if (floatval($_POST['price']) <= 0) { $errors[ ] = 'Please enter a valid price.'; } With the above code, page does not display in browser. Correct code: // price must be a valid floating point number and // more than 0 if ($_POST['price'] != strval(floatval($_POST['price']))) { $errors[] = 'Please enter a valid price.'; } if ($_POST['price'] <= 0) { $errors[] = 'Please enter a valid price, greater than zero.'; } (133) 3rd paragraph, beginning "Example 7-1"; The line reads, "Example 7-1 creates the book table using the data types from Table 7-8." There is no Table 7-8. {137} last paragraph; "...use ALTER TABLE table new_column_name old column_name def..." Should read: "...use ALTER TABLE table CHANGE new_column_name old column_name def..." [139] top; You start with a few examples using the tables the reader had created (store.books, store.authors etc.) SELECT * from books; But we just had to change our tablenames and column definitions! (See pages 136 - 138) So books --> publications, authors.author --> authors.author_name. Column books.pages is shown in all examples, but it has been deleted on page 138. Examples on pages 139 - 144 are valid ONLY IF THE READER DID NOT CHANGE the original tables! [192] Throughout; The book uses the Pear module "DB." The examples provided didn't work for me in PHP 5; a little research showed that DB had been deprecated about two years ago in favor of MDB2, which contains DB's feature set. Switching the language references to MDB2 made the examples functional again. [197] In example code, several corrections; The following changes to the code on page 197 of the book will allow the example to run as the author (likely) intended. Cheers! Lines nine (9) through twelve (12) read as follows: 'username' => $username, 'password' => $password, 'hostspec' => $host, 'database' => $database They should be changed to: 'username' => $db_username, 'password' => $db_password, 'hostspec' => $db_host, 'database' => $db_database Also, line thirty-eight (38) reads as: echo htmlentities($row['author ']) . ''; It shoudl be changed to: echo htmlentities($row['author']) . ''; Please note the additional white space after the word "author", which should be removed. {211} last; The example 10-7 shows check box or a multiple select validation code, instead of the a validation code for text areas or text boxes. (220) Example 10-11; Missing the initial angle bracket in the php declaration (220) Example 10-11; configs should be config (on the previous page, we were instructed to call the config directory config, now it's being cites as config) (229) 2nd last line; should read: "printf" not "print" {234} 2nd image; should read: 12/13/05 16:18:01 since it is pm and "G" is hours in 24-hour format [297] example 14-14; Missing closing } for second if test of procedure (342) Solution to Question 7-5; "months" is the name of the table, "month" is name of the column. the solution shown in the book will generate an error. SELECT * FROM months WHERE months LIKE '%ber'; should be: SELECT * FROM months WHERE month LIKE '%ber';