|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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! ![]() |
|
#2
|
|||
|
|||
|
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 |
|
#3
|
|||
|
|||
|
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) 07-11-2000 artist_num 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).] |
![]() |
| Viewing: Dev Shed Forums > Databases > MySQL Help > "something" of the day... ideas? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|