Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 1st, 2008, 08:08 PM
Registered User
 
Join Date: Jan 2008
Location: , , Hungary.
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')";

Reply With Quote
  #2 (permalink)  
Old January 14th, 2008, 06:00 AM
Registered User
 
Join Date: Jan 2008
Location: , , .
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
Reply With Quote
  #3 (permalink)  
Old September 15th, 2008, 01:15 AM
Registered User
 
Join Date: Sep 2008
Location: , , Hong Kong.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:32 AM.


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