I have a web app which users login to it. Every time a specific user logs in, I store the login datetime in a MySQL db:
(yyyy-mm-dd hh-mm-ss)
Each record in the db has a user_identifier and last_login_datetime.
However, I want to make sure that users can only login once a day.
I was thinking about comparing the time function in PHP to the datetime I have in the DB and see if the user was already logged on today.
If the user was logged on today, I'll kick him out.
How do I compare the record in the DB to the time function in PHP to see if the user was logged in already?
Thanks!
SELECT logon_date=CURDATE() AS kick_out FROM users where user_id=xxx.