PDA

View Full Version : Quick SQL question


N8
04-06-2006, 11:57 PM
SELECT t.threadid, t.title, t.firstpostid, t.lastpost, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, LEFT(p.pagetext,120) as pagetext
FROM " . TABLE_PREFIX . "thread t
LEFT JOIN " . TABLE_PREFIX . "post p ON p.postid = t.firstpostid
WHERE t.forumid = '151'
AND t.open = '1'
AND t.visible = '1'
ORDER BY t.dateline DESC
LIMIT 0 , 17


Could someone please edit this so it only grabs threads posted that day.

And also one that would grab 17 of the next newest threads, not including those posted that day if possible?

Thanks :)

akanevsky
04-06-2006, 11:59 PM
SELECT t.threadid, t.title, t.firstpostid, t.lastpost, t.replycount, t.postusername, t.postuserid, t.lastposter, t.dateline, t.views, LEFT(p.pagetext,120) as pagetext
FROM " . TABLE_PREFIX . "thread t
LEFT JOIN " . TABLE_PREFIX . "post p ON p.postid = t.firstpostid
WHERE t.forumid = '151'
AND t.open = '1'
AND t.visible = '1'
AND t.dateline >= TIMENOW - 86400
ORDER BY t.dateline DESC
LIMIT 0 , 17