Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Check date, if time is +24hrs allow vote in PHP?
Hi there, I'm setting up a vote system on website using a html and php.
I can explain it in English
The user inserts there name, and picks their vote. On submition it then saves the username to an sql database with "username" and "datesubmitted, (the time in h:i:s a format);" as the fields.
How then would I add a query to the script to check whether it has been 24+ since the previous vote hours? Basically it looks at the "datesubmitted" so the user can vote again and if less than 24hrs, kill the script.
Thanks!
1 Answer
- DozoLv 69 years agoFavorite Answer
mysql> SELECT TIMEDIFF('2008-12-31 23:59:59.000001',
-> '2008-12-30 01:01:01.000002');
-> '46:58:57.999999'