Far Cry Posted April 1, 2012 Share Posted April 1, 2012 I have an items table that holds basic info such as id, name, damage etc. values of that item My question is: If I wanted to add a shop where users could buy items, would it be a good idea to make a new database table that holds just one column per item that would be sold at that shop and have it contain the same values as the items table. Then once that item is purchased, have those values copied to the items table? May sound confusing. Just don't know if this idea is at all efficient. Quote Link to comment https://forums.phpfreaks.com/topic/260153-how-should-i-go-about-building-this/ Share on other sites More sharing options...
requinix Posted April 1, 2012 Share Posted April 1, 2012 Assuming there's just the one shop and there are an infinite number of non-tradeable items, Yes, have a table listing the items for sale. It'll surely have more columns: while items can have a base value I'd make the shop list its own value (which may very well be the same as the base value). When someone buys you "copy" the item to their inventory. I mention "infinite number" and "non-tradeable items" because if that's not the case then things are a bit different. Quote Link to comment https://forums.phpfreaks.com/topic/260153-how-should-i-go-about-building-this/#findComment-1333408 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.