Jump to content

How to show Quantity?


Stalingrad

Recommended Posts

Hello. I'm building a shops script for my website. I want to be able to show all of the items somebody has in their shop, and how many of that item they have. I've run into a little problem. I know how to show how many of the item they have, but how do I make it so that it shows only one row for that item, instead of one row for each item they have? Here's an example:

 

Let's say I have three pineapples.

 

It shows this in the stock table:

 

Item    Quantity    Price  Delete?

Pineapple    3          300        X

Pineapple    3          300        X

Pineapple    3          300        X

 

My question is, how do I get it to show like this:

 

Item      Quantity  Price      Delete?

Pineapple    3          300        X

 

I want it to show only once.

 

If anybody could help me out, and show me how to do this with simple PHP, I would really appreciate it, thank you! =]

Link to comment
Share on other sites

It shows 3 quantity for each row because I can't merge the row into one. Like, I want it to show that I have 3 of the item. In the database, I have 3 different item id's. Each item has a unique item id. I want to show that I have three of the same item name, but three different item ids.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.