Quote:
|
Originally Posted by HHSJosh
I am currently working on a news posting script for my team's site using PHP. I've got everything down for posting and adding news, but I need a way to have only the most recent posts added. I tried to create a while loop so that only the 5 most recent posts show on the index page, but it didn't work. If anyone can help me figure it out, help would be greatly appreciated. And i simplified the part of the code that displays the post.
...
|
If at all possible, would you be able to use a database like MySQL?
If not, then why not just write the newest news information at the top of the file? I believe there's a way to set the file pointer to the beginning of the file before you write.
(I can't supply code for doing the file stuff...I've had issues with doing that in the past)