You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it should Update the lastLogin field with $loginTime value.
but it produces an error: You must use the "set" method to update an entry.
when I change 'lastLogin' to a text field type it works correctly.
CI v4.0.4
OS: Windows 10
Web server apache
PHP v7.4
The text was updated successfully, but these errors were encountered:
k-msalehi
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Aug 9, 2020
You know you can have MySQLi automatically update the datetime fields if you setup your tables like this:
'created_at' DATETIME DEFAULT CURRENT_TIMESTAMP, 'updated_at' DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 'deleted_at' DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
Then you do not have to worry about them being set. Make sure that you escape the field names had to change to single quotes for it to insert into the code tags.
@InsiteFX Using CURRENT_TIMESTAMP is not really applicable here... also this method has two pitfalls - it does not always use the timezone we want (and we're not always able to set it to what we need). And the second is that the value is always updating ;)
@pars0097 Please check if you have lastLogin listed in your model's $allowedFields.
it should Update the lastLogin field with $loginTime value.
but it produces an error: You must use the "set" method to update an entry.
when I change 'lastLogin' to a text field type it works correctly.
CI v4.0.4
OS: Windows 10
Web server apache
PHP v7.4
The text was updated successfully, but these errors were encountered: