When saving to a model, created and modified aren't automatically populated by CakePHP. Using SQL Server
Hi when saving to a model, my created and modified fields aren't automatically populated by CakePHP. It was automatically populated when I was using MySQL but now it isn't. I'm not using NOW() back when I was still using MySQL. Why is it? Also when a field's value is not set 'NULL' (with quotes) is inserted causing errors because SQL Server says I 开发者_Go百科can't insert a string to a field of type smallint/date etc. How do I fix this?
Thanks in advance!
I would set NULL
as a keyword rather than quoting it, which I imagine is why your database thinks that it's a string.
Have you double checked the schema of the database to ensure that the created
and modified
fields are still DATETIME
fields.
Also you say "SQL Server", and mention MySQL, so I assume that you are now using MSSQL?
精彩评论