[sql]SELECT threadid
FROM thread
WHERE postusername = 'John'
AND dateline > (UNIX_TIMESTAMP(NOW()) - 172800)
AND visible = 1
ORDER BY lastpostid, threadid DESC
LIMIT 15;[/sql]
That will return the threads for the last 48 hours, less scanning to the tables.
I did this off my head, so play with the ORDER there, if it's not right.
EDIT: you should definitelly consider forum based perms for your query, orelse anyone could see private threads on public areas.
|