runeveryday — 2011-03-22T07:57:51-04:00 — #1
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.
anthonysterling — 2011-03-22T07:59:54-04:00 — #2
What SQL do you have now?
r937 — 2011-03-22T08:11:21-04:00 — #3
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
runeveryday — 2011-03-22T20:35:15-04:00 — #4
could i use this (time()-3600*24*7) to represent the latest one week
you command is complicated
r937 — 2011-03-22T20:43:10-04:00 — #5