![]() |
Check this query please
PHP Code:
mysql error: Unknown table 'forum' in field list Any ideas how to grab info from to tables in the same query? Thanks a bunch |
Try a JOIN:
PHP Code:
|
Ya i tried the LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid)
But i kept getting a mysql error: Column: 'forumid' in where clause is ambiguous |
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:
|
Ok this is what i placed
PHP Code:
Quote:
PHP Code:
|
All times are GMT. The time now is 02:45 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|