I Have project in which a module needs to display the list of data using a group of specific criteria:
Today
Week
Month
Year
The Database table contains a date field which has datatype as BIGINT(10) and through PHP code we insert time() function value into it. which insert some value like 1311144077,
Now I need to fetch the records from my table as per the labels mentionedabove, how can i do that?
While you’re storing datetime in epoch timestamp format, I think solutions using MySQL date/time functions could be very slow. So, I suggest using timestamp itself like below codes.
Usage example
In query