Hi I have a script that was developed and can no longer reach the developer. It's not that old either. Anyhow, it was running fine on a dedicated server with WHM, Cpanel... but I recently had to move to a new host. I made sure the new host server matched the old server. Same php, apache, mysql... just slightly newer version of cpanel. I went through all of the php options and made sure set up the same. Checked locales too. PROBLEM: Throughout the code, there are two methods used to capture datetime value. 'timestamp' => new Zend_Db_Expr('NOW()'), PHP: OR $action->timestamp = date('Y-m-d H:i:s'); PHP: I've made sure that the value is right, by placing a mail() near these kinds of lines to send me the value generated. It's correct. But... the value is given to zendframework which handles the mysql insert, the value in the datetime field ends up as 0000-00-00- 00:00:00 I don't know much about zendframework... but it's driving me crazy. I changed the datetime type to varchar and the value zendframework attempts to insert is just 2012... so mysql is not accepting that value and results in 0000-00-00- 00:00:00 I have no idea why it's doing this. Same code, almost identical server setup. Couple differences with the new server is that it has suhosin and mod_security installed. But I dont know why that would make difference. I would be grateful for any suggestions.
I had this problem recently and changing the field to varchar worked. I see that varchar works for you, but not exactly as it's supposed to. Check your varchar field and make sure the "Length/Values" is long enough to store the whole string.
Thanks for the reply Andre91, but I can't change the types... I have to leave them as date type as there's lots of date calculations, and several tables and fields. I'm sure that would be a bad performance hit.
Please provide the table structure and the pieces of code under the above (the actual Zend DB Model function that does the insert/update).
mmm... there are a lot of tables. And... there are sooo many files. Theres the zend framework library, and then the added for the whole site. I really wouldn't know what to grab. I know this makes it harder... but I really thought that since the issue was not with the code itself, since it worked on previous server, that some ZF pro's might have some ideas on server config. New server has suhosin and mod_security. Suhosin actually created some issues which I fixed... like session/cookie value encrytion... etc.. Any ideas on that? Thanks for the reply.