Hi, I need to create a script that calculates lottery numbers. I have done this but the hard part is when the draw is done. Say I have the following variables:
$lastdraw - unix timestamp for the last draw date
$day - the day of the draw (ie 1= Monday, 2 = Tuesday...)
$hour - the hour of the draw (ie 20 = 20:00)
Each time a a draw is made the unix timestamp is recorded in the database and then put in the variable $lastdraw to help work out whether the draw should be done.
What I need to decide is whether the day and hour has come and whether it has been a week after the last draw.
I have no idea at all how I can do this and it's been rattling my brain for some time.
I hope I have made this clear and look forward to hearing your advice. Thanks
$lastdraw - unix timestamp for the last draw date
$day - the day of the draw (ie 1= Monday, 2 = Tuesday...)
$hour - the hour of the draw (ie 20 = 20:00)
Each time a a draw is made the unix timestamp is recorded in the database and then put in the variable $lastdraw to help work out whether the draw should be done.
What I need to decide is whether the day and hour has come and whether it has been a week after the last draw.
I have no idea at all how I can do this and it's been rattling my brain for some time.
I hope I have made this clear and look forward to hearing your advice. Thanks