Just need to specify where the forumid field is from. So this will work.
[SQL]
$info = $DB_site->query("
SELECT
thread.threadid as threadid,thread.title as title, thread.forumid as forumid,
thread.postusername as postusername,thread.postuserid as postuserid,thread.dateline as dateline,
thread.views as views,thread.replycount as replycount,forum.title as forumtitle
FROM thread AS thread
LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid)
WHERE forum.forumid IN($id)
ORDER BY threadid DESC
[/SQL]
However, if this script has access to $forumcache you don't need to select the forum title from the table, and therefore no need for a join.
such as...
PHP Code:
$info = $DB_site->query("
SELECT
thread.threadid as threadid,thread.title as title, thread.forumid as forumid,
thread.postusername as postusername,thread.postuserid as postuserid,thread.dateline as dateline,
thread.views as views,thread.replycount as replycount,
FROM thread AS thread
WHERE thread.forumid IN($id)
ORDER BY threadid DESC");
while($item = $DB_site->fetch_array($info))
{
$item['forumtitle'] = $forumcache["$item[forumid]"]['title'];
//rest of your code
}
Both will have the same results, but the second would be quicker because there's no join. (this is of course if the script has access to $forumcache)