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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.