Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cakePHP - modified field not updating

Tags:

cakephp

Any ideas on how to debug a modified field that is not being updated? The created field works fine.

I'm not sure what code you would need to look at so let me know!

Thanks

like image 996
AlexBrand Avatar asked Aug 01 '11 01:08

AlexBrand


2 Answers

I got the same problem today and found out the modified field is only updated if any changes have been made, otherwise the field will not be touched.

like image 108
daerentis Avatar answered Oct 10 '22 21:10

daerentis


Like Anh Pham said, the modified and created field need to be DATETIME and they also need to default to NULL, as explained in the CakePHP book about the subject.

like image 35
Charles Sprayberry Avatar answered Oct 10 '22 21:10

Charles Sprayberry