i'm trying to add a database field called "lastLogin" which should populate each time someone will log in. there's an error when trying to add the field:
#1294 - Invalid ON UPDATE clause for 'lastLogin' column
i'm not sure what's wrong - i'm having the following settings in phpmyadmin:
field: lastlogin
type: date
standard: none
attribute: on update CURRENT_TIMESTAMP
any idea what's wrong?
thanks
Your field type is set to date should be timestamp or datetime.
The DATETIME type is used when you need values that contain both date and time information. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.
The TIMESTAMP data type has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC. It has varying properties, depending on the MySQL version and the SQL mode the server is running in. These properties are described later in this section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With