Showing posts on external page not working
#5
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:
$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"
);
[MyBB 1.8 mods] - Offer me a coffee
Do not ask me help through PM or Discord
Reply


Messages In This Thread
RE: Showing posts on external page not working - by Crazycat - 2021-01-18, 10:38 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)