Jump to content

Table Structure and date question


SilentDeath

Recommended Posts

Hello,

 

I plan on running a contest of sorts and I would like to know how to best count the amount of points accumulated in a day. At the moment i just have a setup with id | name |  points. Would I have to create a new column for each day or something like that?

 

Any help would be much appreciated. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/216533-table-structure-and-date-question/
Share on other sites

I would have two tables at that point, something like:

 

The points table:

P_ID | P_DATE | P_POINTS

 

The user table:

U_ID | U_USERNAME

 

where U_ID -> P_ID and every day a new row is inserted (would probably be a cron job) in the points table with the points accumulated for the day.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.