how to write the code in php that get the articles' title with the most replies in latest one week in mysql? eg: the table name is "threads". the time field is "dateline" whose style is like this (1300774889), the article title is "subject". the reply field " replies" thank you.i want to get 10 records.
What SQL do you have now?
i guessed the articleid column
, COUNT(replies.replies) AS replies
JOIN threads AS replies
ON replies.replies = threads.articleid
AND replies.dateline >= UNIX_TIMESTAMP(CURRENT_DATE - INTERVAL 7 DAY)
BY replies DESC LIMIT 10
could i use this (time()-3600*24*7) to represent the latest one week
you command is complicated