0
Is it possible to do a timer column, which calculates 24 hours? For example, PHP starts this timer in this column, and until it resets the user is prevented from performing such an action. However, when it Zera, it goes back to 24:00:00 and only starts when the user runs the process which can only be done every 24 hours.
Update: I managed to add the table to date and time perfectly. I’m just wondering how to compare this date recorded in SQL and the current date to see if it’s been 24 hours...
Picture of the SQL table:
I did as you said. But now as I compare the two to see if it’s been 24 hours?
– GGirotto
You can use the function
date_diff()
if you have PHP 5.3+, but you can do this directly in sql using the querySELECT TIMEDIFF(NOW(), last_vote)
.– Eduardo Silva
Interesting this function
TIMEDIFF
. And she returns in hours the result?– GGirotto
@William the easiest way to see the output of the function is to do a test in Mysql. the function returns the time between the two dates, with hours, minutes and seconds...
– Miguel Mesquita Alfaiate
I used the method of friend Blunt above. Thank you.
– GGirotto