1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Rep Power
    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. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Rep Power
    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
  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    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).]

Similar Threads

  1. calendar with popup for each day not opening window
    By squalle in forum HTML Programming
    Replies: 0
    Last Post: January 31st, 2004, 04:34 PM
  2. Loop To Update Column Value Using Cron
    By Volitics in forum PHP Development
    Replies: 0
    Last Post: January 26th, 2004, 12:28 PM
  3. strange day... anyone else relate?
    By Kaleina in forum Dev Shed Lounge
    Replies: 4
    Last Post: October 14th, 2003, 01:59 AM
  4. Replies: 0
    Last Post: October 7th, 2003, 03:50 AM
  5. Just a puzzle- to find day, given the date
    By murugesan in forum C Programming
    Replies: 7
    Last Post: September 16th, 2003, 11:41 AM

IMN logo majestic logo threadwatch logo seochat tools logo