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
https://forums.phpfreaks.com/topic/141661-how-to-show-quantity/
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
https://forums.phpfreaks.com/topic/141661-how-to-show-quantity/#findComment-741558
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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