Jump to content

[SOLVED] Displaying Table Content Question


Guest tantrum_jon

Recommended Posts

Guest tantrum_jon

Greetings.

 

I am attempting to display information from a table within a MySQL database, but I am having a problem with how to write the line to show only what I want.  I am a beginner/intermediate coder and I'm still learning.  Here is what I am attempting.

 

I have a database that will display news and events.  I want to display the news/event title, content and the date of the post.  That is not my problem, pulling that from the database and showing it is particularly easy.  My problem, is I only want to show the 5 newest news and/or events for example.  I am aware that the text WHERE ID = 1 or WHERE ID = >5 can be used, but what would I used to show the newest posts?  I want to show 5 posts, and as I add a new post, I want the oldest to not be displayed, and the newest to be added to the top of the listing.

 

Thank you in advance.

Link to comment
https://forums.phpfreaks.com/topic/46354-solved-displaying-table-content-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.