1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to show most liked posts in a specific time period

Discussion in 'XenForo Questions and Support' started by Ingenious, Feb 22, 2012.

  1. Ingenious

    Ingenious Well-Known Member

    What would be the MySQL query please to show the most liked posts which were posted in a particular month?

    Plain english version: Display most liked posts, ordered with the most liked first, between dates X and Y

    Thanks :)
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    SELECT *
    FROM xf_post
    WHERE post_date BETWEEN UNIX_TIMESTAMP('2008-01-15 00:00:00') AND UNIX_TIMESTAMP('2012-03-15 00:00:00')
    ORDER BY likes
    Mutt and Ingenious like this.
  3. Ingenious

    Ingenious Well-Known Member

    Many thanks Jake.

Share This Page