Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Posts
    3

    Post Unanswered: 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
    --------------------

  2. #2
    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)

  3. #3
    Join Date
    Sep 2009
    Posts
    3
    Ok, thanks froobop, never thought about it)))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •