2014-06-06, 11:57 AM
How to make this query to fetch threads from the category?
$query = $db->query("
SELECT t.*, t.subject AS threadsubject, u.username, u.usergroup, u.displaygroup,
t.dateline AS threaddate, t.lastpost AS threadlastpost
FROM ".TABLE_PREFIX."threads t
LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
LEFT JOIN ".TABLE_PREFIX."users u ON (t.lastposter=u.username)
WHERE t.fid = ".intval($mybb->input['fid'])."
GROUP BY t.tid
ORDER BY t.lastpost DESC
LIMIT 0, {$threadlimit}
");