Wrox Programmer Forums
|
BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6
This is the forum to discuss the Wrox book Professional Ajax, 2nd Edition by Nicholas C. Zakas, Jeremy McPeak, Joe Fawcett; ISBN: 9780470109496
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Ajax 2nd Edition ISBN: 978-0-470-10949-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 1st, 2008, 08:08 PM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default error report

Hi!

I started reading this book yesterday and I found 2 error in the first 2 sample codes.

chapter 2, HiddenFrameExamples, GetCustomerData.php

in line 12: missing ')'
fixed:
Code:
if (is_numeric($sID)) {
chapter 2, HiddenFrameExamples, SaveCustomer.php

mysql_real_escape_string function needs an open database connection.
fixed:
Code:
    //database information

    $sDBServer = "your.database.server";
    $sDBName = "your_db_name";
    $sDBUsername = "your_db_username";
    $sDBPassword = "your_db_password";

    $oLink = mysql_connect($sDBServer,$sDBUsername,$sDBPassword);
    @mysql_select_db($sDBName) or $sStatus = "Unable to open database";

    //get information
    $sName = mysql_real_escape_string($_POST["txtName"]);
    $sAddress = mysql_real_escape_string($_POST["txtAddress"]);
    $sCity = mysql_real_escape_string($_POST["txtCity"]);
    $sState = mysql_real_escape_string($_POST["txtState"]);
    $sZipCode = mysql_real_escape_string($_POST["txtZipCode"]);
    $sPhone = mysql_real_escape_string($_POST["txtPhone"]);
    $sEmail = mysql_real_escape_string($_POST["txtEmail"]);

    //status message
    $sStatus = "";

    //create the SQL query string
    $sSQL = "Insert into Customers(Name,Address,City,State,Zip,Phone,`Email`) ".
              " values ('$sName','$sAddress','$sCity','$sState', '$sZipCode'".
              ", '$sPhone', '$sEmail')";

 
Old January 14th, 2008, 06:00 AM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by doubleb
 Hi!

I started reading this book yesterday and I found 2 error in the first 2 sample codes.

chapter 2, HiddenFrameExamples, GetCustomerData.php

in line 12: missing ')'
fixed:
Code:
if (is_numeric($sID)) {
...
After spending way too much time I finally located the second error you mention: it's on page 30 (and partly in the first version of the code on page 29).

But I don't seem to encounter the first error you mention, not even the line you quote anywhere as line 12 of an example.

Could you please mention the page number that features the error?

Regards, Vincent
 
Old September 15th, 2008, 01:15 AM
Registered User
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The error is occured at the download of the codes for PHP. The missing ")" is at line 12 of GetCustomerData.php.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Crystal report Error monika.vasvani ASP.NET 2.0 Basics 0 June 13th, 2008 10:36 PM
Load Report Error smysyk Crystal Reports 0 November 21st, 2005 01:26 PM
Error While printing report (Crystal report) vikaspaweb Pro VB 6 0 March 8th, 2004 09:53 AM
data report error chow chek VB How-To 1 August 4th, 2003 07:17 AM
data report error chow chek Wrox Book Feedback 1 July 19th, 2003 08:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.