FETNU Posted June 25, 2007 Share Posted June 25, 2007 Before I dive into the coding for the next part of my application, I'm trying to figure out the best way to accomplish this. Here's the history: When opening the page, I grab ALL the items from the ITEM_SELECTION table (mysql database) by item_category (for example baby clothes, toys, bath products, etc..). I then display all those items on the page (so this page would contain all baby clothes).... The user has the option to scroll down the page and change the quantities to whatever numeric values they want. Now, the part that I'm trying to figure out... When the user clicks the "Update Quantities" button I need to Add, update or delete these items to my SHOPPING_BASKET_TEMP table. So, I need to see if the item already exists in the temp table, if so, I either need to update the quantity or delete the row (depending on the value the user entered). If it does not exist, then I need to insert the record into the table. Each page could have up to 20 items on it, so I'm thinking I need to use arrays???? Any recommendations??? I'm fairly new to PHP and mySQL, but I've taught myself everything up to this point and I have pretty good e-commerce application going so far. At this point, I'm mainly looking for a high level explanation to achieve this. Any help over this next hump is greatly appreciated. Thanks! FETNU Quote Link to comment https://forums.phpfreaks.com/topic/57082-multiple-items-to-shopping-cart/ Share on other sites More sharing options...
sasa Posted June 25, 2007 Share Posted June 25, 2007 delete all old values and insert all new Quote Link to comment https://forums.phpfreaks.com/topic/57082-multiple-items-to-shopping-cart/#findComment-282051 Share on other sites More sharing options...
FETNU Posted June 25, 2007 Author Share Posted June 25, 2007 You know, I thought about that, but I wasn't sure if that would be OK to do. Would you then just do a rollback if something failed? Quote Link to comment https://forums.phpfreaks.com/topic/57082-multiple-items-to-shopping-cart/#findComment-282054 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.