Advertisement

07.01.2008 at 09:11AM PDT, ID: 23530726 | Points: 500
[x]
Attachment Details

suggested data type for event ending  with mysql

Asked by ioustinos_sarris in PHP and Databases

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 hereStart Free Trial
[+][-]07.01.2008 at 09:53AM PDT, ID: 21909461

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 09:58AM PDT, ID: 21909509

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.01.2008 at 11:24AM PDT, ID: 21910228

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 10:35AM PDT, ID: 21918753

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.02.2008 at 08:18PM PDT, ID: 21922447

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43 / EE_QW_2_20070628