Get Todays Record From table
SELECT *
FROM table1
WHERE DAY(FROM_UNIXTIME(timestampfield)) = DAY(CURDATE())
Get Current Month Records
SELECT * FROM table1
WHERE
(FROM_UNIXTIME(timestampfield)) =
MONTH
(CURDATE())
MONTH
Get current year Records
SELECT * FROM table1
WHERE
YEAR
(FROM_UNIXTIME(timestampfield)) =
YEAR
(CURDATE())
Just change the table name and timestampfield name .....
Thanks, appreciate this.
ReplyDelete