PDA

View Full Version : Database Structure


Logikos
10-08-2005, 06:58 PM
I'm trying to plan a database structure for a custom mod. Its going to be a personal points, and this is how it will work.

Every saturday I will have a list of points that I will manually add myself. The week starts on saturday and ends on friday. I want to keep a record of points earned everyweek. For instance.

User1 has 150 points for week(1)
User1 has 125 points for week(2)
-------------------------------------------
Total Points: 275

What would be the best approach to handle the weeks orginaized?

Guest190829
10-08-2005, 08:31 PM
You can make the week table auto increment.

Table Scheme: Name: points_record

userid
points_this_week
week_number

I would point total points in a separate table...perhaps the user table. Could be wrong though!

Marco van Herwaarden
10-09-2005, 07:47 AM
Well it really depends on how long history you want to keep. If not too much, then maybe just a serialized array in the user table would be best.

filburt1
10-09-2005, 02:25 PM
Don't serialize stuff into the database unless absolutely necessary. It defeats the purpose of using the database in the first place.

Logikos
10-09-2005, 07:06 PM
Thanks guys, I think I figured out the best way. I'll let you know how it goes. :)