I keep a record of logins in a table. I have columns for id, ip, date and time. From that record of logins I wanna fetch logins made only in the last hour.
I\'m swe
I recommend have one datetime column instead of date and time columns.
Suppose you have a datetime column called last_login:
SELECT id, ip_address, last_login FROM mytable WHERE last_login >= DATE_SUB(NOW(), interval 1 hour);