|
Well, you would have a list of "All items" in your items table.
You can use this to pull what items are available in the purchase screen and how much they cost ( once again the cost can be a column in the items table )
Then in your userdata table.
you would have a colum called items and put them in that colum 1,3,5,2,6,33,231 etc.
So to buy an item i would do this:
Select items and item id from the ITEMS table.
Buy an item and get its ITEM id.
Select items from the usertable ( so the $useritems var woul have 3,2,,34,24, etc )
You then would edit the var you just got back from the users database record to add teh new item ( if they dont already have it )
$useritems = $useritems + ",itemnumber"; ( or as you said, use an array and drop it in that, then update the user items table with that array data )
This would then add it to their own list of items with a matching ID.
If that makes any sense lol?
Last edited by lynxus; 06-10-2010 at 07:16 AM..
|