Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2008
    Location
    New Jersey
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Pulling last 5 items from a table in the database

    So the title might not be correct but hopefully I can explain it here. My website, New Jersey Fishing And Tackle Supplies New Jersey Fishing Reels Rods New Jersey Fishing Reel Parts, has an event page. In here we post fishing reports and anything going on in the brigantine fishing world. I am trying to make a new mobile which is going good and looks cool. if you go to riptide on your phone you will see the beginning of it. What I want is for when someone clicks on fishing reports and new mobile page comes up with the last 5 fishing reports. Just the name of the report. Then when they click on the report and new page comes up with the full report. What I am having trouble doing is getting it so just the last 5 reports are populated into the page. Is there a way to do this??? Or do I just have to go and put the last 5 reports in there every day or so. A big reason I want the last 5 is sometimes if it is a busy we can do 3 or 4 reports in one day so I dont want the mobile site to have lots of them. Let me know if you can help I would appreciate this.

  • #2
    Super Moderator
    Join Date
    May 2005
    Location
    Southern tip of Silicon Valley
    Posts
    2,871
    Thanks
    2
    Thanked 164 Times in 159 Posts
    Sounds like you're needing to use the limit clause in the select statement.
    https://dev.mysql.com/doc/refman/5.0/en/select.html

  • #3
    New Coder
    Join Date
    Sep 2008
    Location
    New Jersey
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you. I think that will work.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •