2014-05-21, 06:36 PM
Please help me, how to make this query fetch only threads that are =< 24h old. Only that are less than 24h old,
What is I add to this query: t.dateline AS threaddate
$max = 5;
$query = $db->query("
SELECT t.*, u.username, f.*, p.displaystyle AS threadprefix
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
INNER JOIN ".TABLE_PREFIX."forums f
ON (f.fid = t.fid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=t.uid)
WHERE 1=1 $unviewwhere AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
ORDER BY t.lastpost DESC LIMIT $max");
What is I add to this query: t.dateline AS threaddate
if ($thread['threaddate'] =< 60*60*24*2); {
//do code
}