I want to get the current time when a login attempt is processed. I want to get the time retrieved in probably date and hour/min/sec.
I have a database with a field called last_attempt, which holds the date and time of the last login attempt.
Which of the types Datetime, Timestamp, Time or others should I use for the field? And also what method in PHP should I use?
PHP time() is all you need. It returns the current time posted at the server in seconds from epoch january. (You’ll store the result as a unsigned number most likely.)