July 11th, 2000, 07:50 PM
Hey, I'm pretty new to sql.. I'm helping with html and sql for a site (audioglobe.com), and I was wondering if anyone had a good way to do an "Artist of the day" type of thing (it's a music web site). For now we are just going to have it be completely random, and change each day at midnight. Repeats are not a concern because a) we already have about 120 artists and b) within a few months it will not be random anymore, we will actually be picking them ourselves and writing small reviews and interviewing the artists (through email), etc...
I'm just not sure how to do the date stuff.. have it change each day at midnight.. Any help would be greatly appreciated, thanks!
July 11th, 2000, 11:08 PM
Try writing a script that is run by cron at midnight that alters the "artist of the day" link and details.
If your write it in perl, just call it directly. If you write it in php, call it like this:
lynx -dump http://yoururl.com/script.php>>/dev/null
July 12th, 2000, 01:34 AM
I thought of using cron earlier but billy doesn't really need to.
No database is being used in this example, I hope you get the logic of it.
1) Prepare a text file that should contain two lines: (this is for initial only)
2) Everytime your script is called, first read the text file above, then check the current date, if the date matches, keep this text file untouched and continue.
3) If the date doesn't match, update the date line and artist_num's line.
4) Open and read that text file again and get the appropriate artist to be displayed.
[This message has been edited by freebsd (edited July 12, 2000).]