Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 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 Display Modes
  #1 (permalink)  
Old June 12th, 2008, 05:24 PM
Registered User
 
Join Date: Jun 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default Shopping Cart Code incomplete

Hi,

Just to note I have tried the shopping cart example from chapter 08 and the cart.php code is incomplete and does not work. The <form> is not closed with a </form> and the select is also not closed with </select>.

But the main thing is that even after I fixed the code the 'update' cart does not post at all.

Wondering if you could provide any suggestions.

cheers.

Reply With Quote
The Following User Says Thank You to dipeshedesign For This Useful Post:
kenj (September 30th, 2010)
  #2 (permalink)  
Old July 3rd, 2008, 12:15 PM
Authorized User
 
Join Date: Jul 2008
Location: Syracuse, NY, USA.
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post
Default

It looks like the sprintf() that creates the necessary query is missing a formatting specifier. Using the inventory_process.php script from the downloadable source files as a reference, the statement that starts on line 133 should read:

Code:
$query = sprintf('INSERT INTO %sSHOP_INVENTORY (ITEM_NAME, ' .
    'ITEM_DESCRIPTION, PRICE, ITEM_IMAGE, CATEGORY_ID) VALUES ' .
    '("%s", "%s", %02f, "%s", %d)',
    DB_TBL_PREFIX,
    mysql_real_escape_string($_POST['name'], $GLOBALS['DB']),
    mysql_real_escape_string($_POST['description'], $GLOBALS['DB']),
    $_POST['price'],
    mysql_real_escape_string($_POST['image'], $GLOBALS['DB']),
    $_POST['cat_id']);


-Tim
Reply With Quote
The Following User Says Thank You to tboronczyk For This Useful Post:
kenj (September 30th, 2010)
  #3 (permalink)  
Old August 2nd, 2009, 10:39 AM
Registered User
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default thanks

it is realy nice book.
Reply With Quote
  #4 (permalink)  
Old September 23rd, 2009, 12:06 PM
Registered User
 
Join Date: Sep 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default cart doesn't work!!

Firstly. apologice for my poor English, I'm from Spain.
And second:
I wonder If anyone of us has found any error in chapter 8, because I'm trying
but I' cant make it work.
I have fixed de </form>, the </select> and the query above. But I think there is something wrong in the matrix "qty", because: "foreach" loop don't make anything.
Any Idea?
Anybody found any extra error?
Please, help!!!!

Thanks a lot, and sorry for my English.

Last edited by michelmarquetaj; September 23rd, 2009 at 12:09 PM.
Reply With Quote
Reply


Thread Tools
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
Shopping Cart seannie ASP.NET 2.0 Basics 0 December 12th, 2006 09:28 AM
Altering Shopping Cart Code for Paypal flashcash5 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 April 19th, 2005 09:58 PM
Shopping cart Manoj babu General .NET 0 February 14th, 2005 03:20 AM
Ch 10: Problem with shopping cart example code Storm BOOK: Beginning ASP.NET 1.0 0 October 11th, 2004 03:24 PM
PHP Source Code for Shopping cart haribabu PHP How-To 0 January 27th, 2004 01:10 AM



All times are GMT -4. The time now is 01:35 PM.


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