GilesGuthrie
Staff Emeritus
- 11,038

- Edinburgh, UK
- CMDRTheDarkLord
I have a fairly simple problem, but my addled brain can't see a way out of it.
I'm coding a "photo of the day" function. I therefore want the function to choose a random number, but bind it to something, so the number only changes every 24hrs. The number needs to be between zero and the number of rows in a database table (minus one, obviously). There are currently 79 rows in the database.
It is very important to me that the function should not select consecutive row numbers on consecutive days.
I'd rather not have to put a state table into the database, but if none of you guys can come up with a wizard wheeze for this, then that's my out.
Any thoughts?
I'm coding a "photo of the day" function. I therefore want the function to choose a random number, but bind it to something, so the number only changes every 24hrs. The number needs to be between zero and the number of rows in a database table (minus one, obviously). There are currently 79 rows in the database.
It is very important to me that the function should not select consecutive row numbers on consecutive days.
I'd rather not have to put a state table into the database, but if none of you guys can come up with a wizard wheeze for this, then that's my out.
Any thoughts?