Remove timestamp onUpdate save |
Hello everyone,
I use CI3 and Adminer on my project. I have a field "contact_create_time", and I would like to save the create timestamp here. In the options on adminer I can't leave blank, I don't know if it's the problem ? ![]() Code: $this->contact_create_time = date("Y-m-d H:i:s"); The save is OK. But on update I don't add any update "contact_create_time" and the timestamp are updated... ![]()
When you save or update the record the database is updating your time field.
That's what the (ON UPDATE) CURRENT_TIMESTAMP means. If you do not want it to update the field remove that. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(03-09-2020, 08:42 AM)InsiteFX Wrote: When you save or update the record the database is updating your time field. Thanks for your help. Yes I know but I can't do that on Adminer interface. It's strange. I save me timestamp on varchar to solve my problem... ![]()
If adminer doesn’t let you change that, you should use another tool instead of changing it to varchar!
I can change to VARCHAR and I think I can do with SQL too, but I would like to know if the problem come from adminer and not CI... Thanks
|
Welcome Guest, Not a member yet? Register Sign In |