The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
What's wrong with this query?
Whats wrong with this query?
[sql]SELECT * FROM thread WHERE forum.forumid = 13 ORDER BY ID DESC LIMIT 10[/sql] I get this error: Code:
Database error in vBulletin 3.0.6: Invalid SQL: SELECT * FROM thread WHERE forum.forumid = 13 ORDER BY ID DESC LIMIT 10 mysql error: Unknown table 'forum' in where clause mysql error number: 1109 |
#2
|
||||
|
||||
[sql]
SELECT * FROM " . TABLE_PREFIX . "thread WHERE " . TABLE_PREFIX . "forum.forumid = 13 ORDER BY ID DESC LIMIT 10[/sql] |
#3
|
|||
|
|||
Lol it is not the only prefix Zach He refers to the forum table in the where clause, but forum is not used in the FROM clause. Typical copy&paste&edit error.
[sql]SELECT * FROM " . TABLE_PREFIX . "thread WHERE forumid = 13 ORDER BY ID DESC LIMIT 10[/sql] |
#4
|
|||
|
|||
Thanks .
I don't have time to try this out, but it looks promising.\ Quote:
|
#5
|
||||
|
||||
Quote:
|
#6
|
|||
|
|||
ay ay
|
#7
|
|||
|
|||
Ya goo' ol' pirate!
Still didn't work . Query: PHP Code:
Code:
Invalid SQL: SELECT * FROM thread WHERE forumid = 13 ORDER BY ID DESC LIMIT 10 mysql error: Unknown column 'ID' in 'order clause' mysql error number: 1054 |
#8
|
|||
|
|||
Hmm ORDER BY threadid or forumid maybe?
Dont know what order you want. |
#9
|
|||
|
|||
I would say "ORDER BY dateline desc"
But if you want the last posts prefer this one PHP Code:
|
#10
|
|||
|
|||
Ok, now the DB error is gone.
But, with this code: PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|