Creating an Item Database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Spears
Forum Newbie
Posts: 6
Joined: Mon Mar 23, 2009 10:06 am

Creating an Item Database

Post 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?
enoc22
Forum Commoner
Posts: 33
Joined: Wed Apr 01, 2009 12:45 pm

Re: Creating an Item Database

Post 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
Spears
Forum Newbie
Posts: 6
Joined: Mon Mar 23, 2009 10:06 am

Re: Creating an Item Database

Post 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.
facets
Forum Contributor
Posts: 273
Joined: Wed Apr 13, 2005 1:53 am
Location: Detroit

Re: Creating an Item Database

Post 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.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Creating an Item Database

Post 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.
User avatar
McInfo
DevNet Resident
Posts: 1532
Joined: Wed Apr 01, 2009 1:31 pm

Re: Creating an Item Database

Post 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.
Post Reply