Forum Moderators: coopster
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 get some of the listings to also show on other pages? For example, all of the Odeon listings to 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, so that I can learn and do it all myself.
If the time of the movie is in the past, dont show it.
If the time of the movie is within the next, say, 6 hours, then it can go into an 'expiring' part of the site.
For example
expiring movies -
echo all those movies that times are within the next 6 hours of the server time
You can track each click through another script that auto-increments a table in the database each time its clicked. You can then list the database by ascending or descending by that table.
There are probably numerous ways to do this but that hopefully gives you a basic outline to work off
:)
Anyway we are speaking MySQL database here.
If only published is considered, that’s the easier case: add a column published size 1, default=n.
Create a little script that will update (at your will) the published col to ‘y’
To un-publish edit again and set it to ‘n’
The web page will query the database where publish=’y’
Next deleting “for good”
Read about crontab and cron job, if you need a little tutorial about setting it up:
I have that somewhere here, let me know and I’ll find its WebmasterWorld link.
2) You need to look for time and date in the PHP manual
I would add a column timestamp that will be activated as soon as a new row is added
The rest is reading about timestamp and how comparing “now” with the timestamp
For example if you need to delete something a week old you will create a cron job script that will delete rows WHERE timestamp+1week
3) to show anywhere else your content from a database only requires to duplicate the original script (showing the initial content) and modifying it with your requirement parameters (called a sub-query) for example … where listing =’$odeon’ AND published =’y’ etc..
I never remember where it is but if a Mod in good mood :) read this he will provide you with that link about the basic of grabbing data from a MySQL DB
Good luck, keep us posted.
I never remember where it is but if a Mod in good mood :) read this he will provide you with that link about the basic of grabbing data from a MySQL DB
Always in a good mood, henry0 :)
I think the link that you are referring to is the one in the PHP Forum Library [webmasterworld.com] that gets pointed to quite often: Basics of extracting data from MySQL using PHP [webmasterworld.com]
Wow! Henry0, you, too, sound like you know your stuff. However, as with surrealillusions' response, I didn't understand a word of what you said!
One thing you both mentioned is that MySQL databases will be needed. I'll start learning that stuff right now and get back to you.
Coopster, thanks for the resource!