Ques/Help Small SQL question: Getting posts after certain date

M

Mave

Guest
I've been using this query for years to get the number of posts made by myself in the past 365 days. It works great:

Code:

Code:
    SELECT COUNT(*) AS total
    FROM xf_post AS post
    WHERE user_id = 1
    AND (post.post_date >= UNIX_TIMESTAMP(CURDATE() - INTERVAL 8760 HOUR))

However I want to know how many posts were made in THIS year, so I modified the code to:

Code:

Code:
    SELECT COUNT(*) AS total
    FROM xf_post AS post
    WHERE user_id = 1
    AND (post.post_date >=...

Read more

Continue reading...