The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#22
|
|||
|
|||
ok thanks I'll try that
|
#23
|
||||
|
||||
Quote:
Use a simple query like this, if you really want to get everything from your thread: Code:
$getthreads = $DB_site->query(" SELECT forum.forumid, forum.title AS forumtitle, thread.threadid, thread.title, thread.lastposter, thread.lastpost, thread.postusername, thread.dateline FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid) WHERE open = '1' AND thread.lastpost >= " . (time() - 86400) . " AND forumid NOT IN (0$limitfids) AND visible = '1' ORDER BY thread.lastpost DESC LIMIT 5 "); $thread['forumtitle'] Have fun. |
#24
|
|||
|
|||
Thanks teck, but I'm still getting the same error...
mysql error: Column: 'forumid' in where clause is ambiguous mysql error number: 1052 :ermm: |
#25
|
||||
|
||||
Sorry, my mistake.
Code:
$getthreads = $DB_site->query(" SELECT forum.forumid, forum.title AS forumtitle, thread.threadid, thread.title, thread.lastposter, thread.lastpost, thread.postusername, thread.dateline FROM " . TABLE_PREFIX . "thread AS thread LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid) WHERE thread.lastpost >= " . (time() - 86400) . " AND thread.forumid NOT IN (0$limitfids) AND open = '1' AND visible = '1' ORDER BY thread.lastpost DESC LIMIT 5 "); |
#26
|
|||
|
|||
FINALLY!!!
IT WORKS! At first I still got the error but I played with it a bit and now it works! the final code for that is ... LEFT JOIN " . TABLE_PREFIX . "forum AS forum ON (forum.forumid = thread.forumid) WHERE open = '1' AND thread.lastpost >= " . (time() - 86400) . " AND thread.forumid NOT IN (0$limitfids) AND thread.visible = '1' ORDER BY lastpost DESC LIMIT 5 "); thanks for the help!! |
#27
|
||||
|
||||
You need to leave it:
ORDER BY thread.lastpost because the table "forum" also contains also a "lastpost" row. Also, you can just write it: AND visible = '1' no need to add the "thread.", no ambiguous clause there also. Leave the code as I posted above, at the end with the 2 conditions: Code:
AND open = '1' AND visible = '1' ORDER BY thread.lastpost DESC LIMIT 5 |
#28
|
||||
|
||||
Wasn't that the code which I posted initially ?
|
#29
|
|||
|
|||
TECK,
if I change to AND visible = '1' if gives me again DB error.. so I just left it as AND thread.visible = '1' and its working... thanks for the help.. cinq, I of course thanks u 2 The code is almost the same... just a minor changes.. thanks both of you you really helped me |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|