As some of you may know, I'm making a PHP game. I've got one way to design the news system, but I think it's just terrible on both me and the server.
What happens is, let's say the user wins a boss fight or something, I'd then send to the news the fact they beat him, and what it now means. They'd then go to their home page, where I'd include() the news.php file.
But what I'm having a problem with, is figuring out the best method for going about that. I want a max of 10 news items to be there, and all old news would just be thrown into oblivion. I'm thinking I'd be like, after the battle or w/e,
Code: Select all
mysql_query("UPDATE news1 WHERE username blah blah");
And I'd have 10 entries, being news1, news2, and so on. But would I seriously have to (to make the news the freshest) set what's currently in the news3 entry, to then be transferred to the news4 entry, and so on until it got to news9, then put that in 10, and then toss whatever was in 10? That seems like way too many queries, and this is sort of a big thing, to be making so many queries like that. I just think there's GOT to be a better way to manage this.
What do you think?