If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Inventory Database.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-24-09, 00:41
kostik7 kostik7 is offline
Registered User
 
Join Date: Sep 2009
Posts: 3
Post Inventory Database.

Hi, i have problem with inventory table in database. I have 3 tables players,items and inventory.
Player table - it's where all player's information is stored such as name,age,gender.
Items table - here all item's information is stored such as name,condition,etc.
Inventory - it shows all items that player owns.
And the problem is that every time player loads information about the item (for example our item's id is 111 and it's condition is 10) he will always get item with condition 10. But what i want to do is to save condition for example to 9 without saving it in Items table.So I would be able to change it's condition to anything i want only in my inventory. And using "Items table" like a store. I want to make the item that i just bought to become a unique.




--------------------
Players primary key
player_id
player_name
--------------------
Items
item_id
item_name
item_condition
--------------------
Inventory foreign key
player_id
item_id
--------------------
Reply With Quote
  #2 (permalink)  
Old 09-24-09, 01:30
froobop froobop is offline
Registered User
 
Join Date: Sep 2009
Posts: 3
Then what you would do is make the "condition" value from the items table the default condition of the item.

Then make a condition value in the inventory table and every time a player picks up that item, it automatically starts with, for example condition 10. then when the item becomes used or whatever, you update the condition in the inventory table to a lower one (the condition in the items table is static, just to tell the script what condition a new item would have)
Reply With Quote
  #3 (permalink)  
Old 09-24-09, 13:25
kostik7 kostik7 is offline
Registered User
 
Join Date: Sep 2009
Posts: 3
Ok, thanks froobop, never thought about it)))
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On