Hi there
I have a table that keeps record of events. those events have a field value that i have called ends_at. When a user visits the site he can request to get all the active events, all the events that have not ended. I have two issues that i need to have clarified here.
1) What is the best data type that i should use? Currently i have timestamp, but i was thinking that when the records are quite many the comparison between dates is going to be quite a heavy duty. The unix timestamp would be the best i guess. In that cae it would be a simple long integer in my database table right? Is this a good idea?
2) I was thinking that its a better idea to have a field called "status" which would be 0 or 1 indicating whether the event has ended or not. In that case there should be a script to update this status comparing the current date with the ends_at date. Should this (check all events that have status 1 and see if they should stay 1 or change to 0) happen for every user that makes a request or with an automated script that would run locally on the server every a certain amount of time?
Any advice would be valuable here
Start Free Trial