Display Most Recent News Item
I have used powerCMSBuilder to create news items and wanted to display the most recent news item in the footer of my website. I used the following sql to retrieve the most recent news post:
SELECT pcms2_contents.ContentID, pcms2_contents.ContentGroup, pcms2_contents.ContentValue, pcms2_contents.ContentDate FROM pcms2_contents WHERE pcms2_contents.ContentPageName = 'News' AND pcms2_contents.ContentRefID = 'Main Content' ORDER BY pcms2_contents.ContentDate DESC LIMIT 1
This works fine until you edit the original news item for any reason. It doesn't display the most current edited news item. For an example of what I mean, if you go to my test website at:
index.php
And look at the footer under "Latest News", you will notice that the word "Threshold" is misspelled. If you go to the "News" page you will notice that I have corrected the spelling but the edit is not reflected in the footer.
I've had a good look at the database structure but can't work out how to get the most current edited news item from the database.