close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Display Most Recent News Item

Thread began 5/17/2012 9:21 pm by Lee Firth | Last modified 5/18/2012 10:31 am by Ray Borduin | 431 views | 1 replies |

Lee Firth

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.

Sign in to reply to this post

Ray BorduinWebAssist

ORDER BY ContentPageSetOrder DESC

But you actually don't need a recordset at all for this. If you just add the cms reference to that column and content area it will automatically show the most recent one.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...