vbplusme
01-12-2009, 06:34 AM
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
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