Jump to content

valourous

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

valourous's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I know that it needs to be an if statement so that if the SKU already exists, it will simply update the quantity of the item. This is some kind of merge function, correct? If you could show me the code that makes this possible, it would be much appreciated. Let me know if you need more information/code.
  2. Hey guys, Lovely forum. So I'm building a simple shopping cart from php and mysql. Whenever I update the quantity of the item that I want, I don't want it to duplicate all of the information but instead want it to merge the quantity together. Below is an example of what happens. Note that Test Item has been added to the cart 3 separate times with different quantities (2, 1, and 1). How can I merge this information to show Test Item once with the total quantity? I know it's some kind of merge, but I'm a coding noob. Thanks! Here is some (maybe) relevant information: $insert = "INSERT INTO new_cart (sku, quantity, username) VALUES ('".$ssku."', '".$squantity."', '".$username."')"; mysql_query($insert); } echo "<table>"; $select = "SELECT * FROM new_cart JOIN products ON new_cart.sku = products.sku where '".$username."' = new_cart.username"; What needs to be changed or updated? EDIT: If you need more information, feel free to let me know and I'll post it.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.