FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Inventory





janszmatt
I'm thinking about creating a web-browser based game.

i have created the items database which lists the items attributes.

How do i create and inventory for a player?

im having trouble placing multiple items into the player database and retriving it because i do not know how to store all the items in a single coloum.
hexkid
janszmatt wrote:
im having trouble placing multiple items into the player database and retriving it because i do not know how to store all the items in a single coloum.


You need three tables: one for the players; another for the items; and the third one to connect the first two.

Code:
Player                      Item
Plid | Name ...             Itid | Name ...
-----+----------            -----+---------
  42 | Douglas              1007 | key ring
2001 | Arthur               5308 | remote control

#################################################

Player_Item
Plid | Itid | Qtd ...
-----+------+--------
  42 | 1007 | 1
  42 | 5308 | 6
2001 | 1007 | 3


With the tables above, you can see Douglas has 6 remote controls while Arthur doesn't have any.
X3 Talk
Yes, that is how you have to do it for things like blogs etc. (where there is more than one blog or user).
kirii
erm.....i dunno,soryy.but i'm happy u know how to do a game.May i learn from u? Laughing
X3 Talk
Yes.
It depends what sort of game you wish to make, and, as a result you will have to choose if the game will just be a series of web pages (i.e. a pick a path story) or a full on 3D experience.

It also depends on if you are making this for internet and your computer.

I am VERY busy at the moment, however my Wiki x3talk.elwiki.com will have some pages dedicated to programming and how to. I can also answer your questions.
janszmatt
how do i retrive the data?
Related topics
Site Advertisement and How to get more traffic
Kingdom Hearts... The Original, CoM, and 2
Runescape - OFFICIAL THREAD
what is your Job?
My first 2 Pages
How to become a millionaire on the internet?
sims 2 -nightlife , review
PC or MAC?
Doom RPG cellphone game
Looking for accounting software
legalize (soft)drugs
One Liners:: Funny and Somewhat Inspiring
Separating contents of MySQL row and put them in variables?
Alerts -Website Inventory
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.