Just as an example, imagine that on my web site I have a list of times during which a movie will be shown at different cinemas. For example: 12:00 Odeon 13:00 UCI 14:00 Cineworld 15:00 Odeon 16:00 UCI Questions 1) How can I get each listing to delete itself once it has expired? 2) How can I make it so that the list can be sorted into New, Expiring and Most Popular (most clicked)? 3) How can I make it so that some of the listings also show on other pages? For example, all of the Odeon listings also show on my Odeon page? I realise that my questions are very broad. However, I don't expect anyone to do this for me. Please just give me a basic outline, that I may learn and do it all myself.
Although I'm a beginner myself, I know that you would need to use databasing for these tasks. Look up MySQL. 1) There might be an expiration feature on MySQL, I'm not sure. If not, you can probably use CRON on Linux or Task Scheduler on Windows. At a timed schedule, you would have a script run that checks for old times in your MySQL database and deletes them. 2) These would be done with MySQL queries. You would have your data in a MySQL database. Sorting the data would be a matter of pulling it up through different queries. I haven't done this myself yet, so I'd appreciate if someone else gave more information on this task... 3) You can store all the data in a MySQL database. On your other page, such as the Odeon page, you can pull up rows from the database where it is Odeon. Hope this helps!
MCJim, thanks for the help! It sounds complicated, man. I only started learning PHP yesterday, so it might take me a little while to understand this stuff and get it done. Does anyone else want to elaborate on MCJim's advice? Step-by-step instructions would be nice!
What do you mean by "delete itself"? For instance, I open the page, I see the times and I leave home. Do you want that my page to display the updated values when I get back, without anyone hitting "Refresh page"? If so, you should refresh the page automatically, by reloading every x seconds, using JavaScript. On the other side, if you want for someone to get only the most recent values, you run a query against the current time, and display only what it's after the (currrent time +/- x minutes) What is New? New from someone's last visit? Or new in that week? Please define "New". Same for expiring. For the most popular question : every time someone clicks on a link, you increment a counter value for that link. The counter is stored in the database. When displaying, you sort descending the counter list and display the coresponding links. One PHP script works the same, no matter on what page you use. For instance, if you have a function "Display_Odeon ()" you can use on any page you want. All calls to that function will display the same information, because they use the same database.
i would just do an if else statments to check date and times and if its a dead film run a delete SQL string