Guys,
Any idea how I could code in php so that the latest 10 posts make it to the index page?
Any guidance will be appreciated.
Thanks
latest post to the front page in php
Moderator: General Moderators
-
mattpointblank
- Forum Contributor
- Posts: 304
- Joined: Tue Dec 23, 2008 6:29 am
Re: latest post to the front page in php
SELECT * FROM posts ORDER BY postID DESC LIMIT 10
Re: latest post to the front page in php
wow that easy? I just need a query? thanks a lot
-
mattpointblank
- Forum Contributor
- Posts: 304
- Joined: Tue Dec 23, 2008 6:29 am
Re: latest post to the front page in php
Well, you'll have to then loop through the results using mysql_fetch_array and do something with them, and obviously adapt the query to fit your database structure. But yeah, in principle it's simple.