Ok, sorry for the "buy" and "get" just read them as buy and get, i just have them in quote because the user doesn't really get the items in life the just get them for the site. See they use points on my site to get items for their account.arborint wrote:Are you asking "how do I get the number if items that have the same shopid?"tecktalkcm0391 wrote:Ok, now I have another question... Would I just do something like select * from items where location='shop'
and then see how many rows come up to show the quanity.
By "buy" do you mean add to a cart or purchase at checkout?tecktalkcm0391 wrote:How would I have the user "buy" the item. and then make the owner the username of an item in the cart without having two user "get" the same item, but only the first one gets it.
What does "make the owner the username of an item" mean?
When you ask "without having two user "get" the same item, but only the first one gets it.", does "get" mean the same as "buy" above?
And when you say "the same item," we would need to know if each item/SKU is a unique thing for sale, or do they have a inventory quantity?
Each item as a different number because each item can be traded or sold to another use so I can't just have 300 eggs with the same id, cause how would the database know which item goes to who, and it would just be more confusing in my view of it.
I really don't care how big the database is, but how would I do it without the database?aerodromoi wrote:Looks like the former, as each book has a unique id.arborint wrote: And when you say "the same item," we would need to know if each item/SKU is a unique thing for sale, or do they have a inventory quantity?
Personally, I wouldn't use the unique id approach, as it only comes down to using more database space than actually necessary.
aerodromoi
See my goal is to have a shop that brings out the items (like below) (expept there is a picture on top). When they click on the picture, it gets added to their cart if they have enought money (on there account), and if they don't it displays a message. If they do it goes in there cart then the number of items in stock goes down 1, and it just shows the shop page (like below) still. After they are finished shopping they pay. And they get their items, which they have to use, trade, or sell. ( I don't need help with that for now). I just need to have it so that the shop can tell what is for sale, what items users have in there cart, and which items are owned by users, and which user it is.
How would I do this! Please please please help!Book 1
43 in stock
Cost: 540
Icecream
25 in stock
Cost: 742
Jelly
20 in stock
Cost: 481
Cookie
27 in stock
Cost: 1,281
Pizza
22 in stock
Cost: 963
Milk
38 in stock
Cost: 208
Eggs
28 in stock
Cost: 193
Soda
8 in stock
Cost: 446