The trouble is that you (or someone else) had replaced the constant (TABLE_PREFIX) with an hardcoded value without changing the quoting.
As you use the MyBB tables, your code must be:
If you really want to hardcode the tablename (deprecated):
As you use the MyBB tables, your code must be:
$query = $db->query("
SELECT t.tid, t.fid, t.uid, t.username, t.subject, t.replies, t.views, t.lastposter, p.message
FROM ".TABLE_PREFIX."threads t
INNER JOIN ".TABLE_PREFIX."posts p ON (p.tid=t.tid)
WHERE t.fid='2' AND t.visible='1'
ORDER BY t.dateline DESC
LIMIT 6"
);
If you really want to hardcode the tablename (deprecated):
$query = $db->query("
SELECT t.tid, t.fid, t.uid, t.username, t.subject, t.replies, t.views, t.lastposter, p.message
FROM customboardprefix_threads t
INNER JOIN customboardprefix_posts p ON (p.tid=t.tid)
WHERE t.fid='2' AND t.visible='1'
ORDER BY t.dateline DESC
LIMIT 6"
);