mattal999 Posted September 27, 2007 Share Posted September 27, 2007 i have a page, gorace.php, that lets users have a race. When the race is finished (javascript) then the page goes to wither won.php, or lost.php whch adds the value of 1 onto racestoday in a mysql table. my question is: How can i make it limited to 2 races a day? thanks! Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/ Share on other sites More sharing options...
rarebit Posted September 27, 2007 Share Posted September 27, 2007 What two races a day in total, per session, account, or what? Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356469 Share on other sites More sharing options...
mattal999 Posted September 27, 2007 Author Share Posted September 27, 2007 each person is allowed two races a day soz for cunfuzzlation... Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356487 Share on other sites More sharing options...
rarebit Posted September 27, 2007 Share Posted September 27, 2007 Have a field called something like 'date_of_last_race', then if num_races < 2 && now > date_of_last_race + 86400 let em run, oh, also reset num races at this point Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356496 Share on other sites More sharing options...
mattal999 Posted September 27, 2007 Author Share Posted September 27, 2007 i can make the dates and everything but how can i make it automated that he user gets another race at this point? Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356497 Share on other sites More sharing options...
rarebit Posted September 27, 2007 Share Posted September 27, 2007 either you display the race data or not! Maybe just give them a picture of the bookies with a closed sign? Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356499 Share on other sites More sharing options...
mattal999 Posted September 27, 2007 Author Share Posted September 27, 2007 no, im sorry, im not making this clear... How do i make it check if the date and time of the last race was 12 hours ago? hopefully that clears it up? Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356504 Share on other sites More sharing options...
rarebit Posted September 27, 2007 Share Posted September 27, 2007 12 hours = 12 * 3600 = 43200 seconds Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356518 Share on other sites More sharing options...
mattal999 Posted September 27, 2007 Author Share Posted September 27, 2007 any chance of an example? i really am quite lost here ??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/70912-2-races-a-day/#findComment-356534 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.