Page 1 of 1

Creating an Item Database

Posted: Sat Apr 11, 2009 2:29 pm
by Spears
I'm wanting to have an item database that stores items, item descriptions, and quantities for each member of my site but I don't really know how I should approach this. Any suggestions?

Re: Creating an Item Database

Posted: Sat Apr 11, 2009 3:38 pm
by enoc22
Do you know Mysql(or other database language) ? if you don't i would strongly suggest you start!
I would start by learning about Sql
Just my two cents, take it for what its worth


Oliver

Re: Creating an Item Database

Posted: Sat Apr 11, 2009 9:51 pm
by Spears
Yes I know MySQL. The game I need the database for is a PHP/MySQL driven game. I'm no expert at either but I wouldn't be considered begginner either. In other words, I'm intermediate. :P



The problem is I don't know the structure I would need. Would I need to have a table for each player that lists the number of each item they have or something? Or is there a simpler way.

Re: Creating an Item Database

Posted: Sat Apr 11, 2009 9:58 pm
by facets
sounds like you could get away with a single table (as long as you can access the other tables for reading)

member_id,item_description_id(or name), qty

At a pinch see if you can access your database with a query browser or phpmyAdmin it may help you visualise the data.

Re: Creating an Item Database

Posted: Sat Apr 11, 2009 10:33 pm
by califdon
Spears wrote:The problem is I don't know the structure I would need. Would I need to have a table for each player that lists the number of each item they have or something? Or is there a simpler way.
Well, that is a problem, for sure, since the structure of the data stored in a database is the whole ballgame. It should help for you to read some tutorials on database design, such as http://en.wikipedia.org/wiki/Relational_model or http://www.anchor.com.au/hosting/suppor ... alDatabase.

A database is a model of some segment of the real world. The very first step should be to determine the scope of your data model, that is, what it will represent. Then you must identify the entities that will be represented, their relationships to each other, and the attributes of each entity. Until you have done this, usually in writing, there's no point in even discussing anything beyond that.

Re: Creating an Item Database

Posted: Sat Apr 11, 2009 10:34 pm
by McInfo
I was just about to say the same thing...

It is good to know the basics of database design. If you don't want to take a course at your local university or buy a book on the subject, this is a good place to start: http://www.google.com/search?q=database+design+tutorial

Edit: This post was recovered from search engine cache.