How to build a data table?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
GiaTuan
Forum Newbie
Posts: 14
Joined: Sat Oct 01, 2011 1:19 am

How to build a data table?

Post by GiaTuan »

I'm doing a little game with flash and php.I have not thought out the data table will look like.
I have a table of players: playername, birthday, password.
A player will have five buildings,the number of wood products,food,population,a mailbox containing the message from the team or other players.
The building will have attributes such as x, y, level, capacity, number of worker
How to build a data table?
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: How to build a data table?

Post by califdon »

There is a fairly rigorous process of designing a relational database. It begins with identifying what "entities" will be represented, then how these "entities" are related to each other, and what attributes each entity needs to have. I recommend that you read some of the following:
http://www.kirupa.com/developer/php/rel ... design.htm
http://www.dreamincode.net/forums/topic ... alization/
http://woork.blogspot.com/2008/09/10-us ... abase.html
http://www.atlasindia.com/sql.htm

The very first thing you will need to determine is what database engine you will use. Here in this forum there is emphasis on using MySQL, but there are several other options, all of these are free and open source: PostgreSQL, SQLite, and others.
GiaTuan
Forum Newbie
Posts: 14
Joined: Sat Oct 01, 2011 1:19 am

Re: How to build a data table?

Post by GiaTuan »

I work with SQL server.Currently, I use mysql and php.Usually only two primary key or a foreign key
But here the players have too many things.A person who has many building.Each building has attributes.
What should I do?keys...
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: How to build a data table?

Post by califdon »

You should study the references I provided. They describe the process you need to follow.
Post Reply