The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help with a query...
Hello and Happy New Year to All!
I have this query to find the latest post and it works great. $sql = " SELECT `pagetext`, `postid` FROM `post` WHERE `pagetext` LIKE '%content%'ORDER BY `postid` DESC LIMIT 1 "; $result=mysql_query($sql) or die(mysql_error()); Now, I need to find the latest post that is made in a particular forum. When I started checking into what the query needed to be, I discovered that the `post` table has no direct reference to the forum that contains the post but indirectly uses the `threadid` and the `thread` table has the forumID reference. So the question is, how do I modify the above to SELECT the latest post from a specific Forum? Any help greatly appreciated TIA |
#2
|
||||
|
||||
You need to use MySQL joins. Google has plenty of tutorials, but I will point you to one: http://www.tizag.com/mysqlTutorial/mysqlleftjoin.php.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|