I'm working on a project withs ome friends, and i have one idea, but i dont think it will work or be the best. And i can't think of any other way, so i came to ask for opinions!
Ok i've got a table of items, all withtheir own id and all. Ok, now i have another table for the users items. The way i have that set up is something like:
UserID | i1 | i2 | ..... i29 | i30
the i1 - i30 are for the items in their inventory, and i was goignt o store the itemID in those places. Only now that i think about it this doesn't seem like the best of ideas. So i was wondering if anyone had any suggestions of what i should do...
Database design
Moderator: General Moderators
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
ok, i get it now. my user_ietms table would be like userID | itemID.
ok, so then would my select be something like...
ok, so then would my select be something like...
Code: Select all
SELECT *,* FROM items,user_items WHERE items.ID=user_items.itemID AND user_items.userID={$_SESSIONї'id']}