SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: marticle help.

  1. #1
    ? big bad opus's Avatar
    Join Date
    Jun 2001
    Location
    DC
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    marticle help.

    i'm no php wiz so can't figure this out.

    for my front page i want to list the three newest articles for each category. for example, i review section. on the my front page i want to have the the 3 newest reviews added to my database and another list of the three newest interviews and so on.

    anyone got any solutions for me? throw your ideas at me.

    thanks in advance

  2. #2
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You'll need a DateCreated column in your tables with MySQL type DATETIME which you assign a value of NOW() whenever you insert a new entry in your tables. This will track their creation date. You can then select the three most recent very simply:

    SELECT * FROM tbl_name ORDER BY DateCreated DESC LIMIT 3
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Babys got backa hard back, that is: The Ultimate CSS Reference

  3. #3
    ? big bad opus's Avatar
    Join Date
    Jun 2001
    Location
    DC
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    my first born child will be named "kyank"


Bookmarks

Posting Permissions

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