![]() |
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 |
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.
|
All times are GMT. The time now is 05:00 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:
|