Re: DB_DataObject and MySQL timestamp: why manual query?
| From: | Alan Knowles | Date: | Fri, 30 Dec 2005 09:09:58 +0000 |
| Subject: | Re: DB_DataObject and MySQL timestamp: why manual query? | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-40858@lists.php.net to get a copy of this message | ||
Markus Fischer wrote:
Hi, as the http://pear.php.net/bugs/bug.php?id=630 and the source says (// dont insert data into mysql timestamps // use query() if you really want to do this!!!! ), what is the reason behind this? Timestamps have a documented behaviour in MySQL. If it is not set and it is the first column, it's set to the current time. But if it has a value it is set to this value.The problem occurs when you get and update, since the value is set to the old one, it would try and update the value to the wrong thing, so the best way to deal with it was to ignore it. (as this would be the requirement 99% of the time) - if you are trying to set it manually, you probably should be using datetime...?? Regards Alan
I've had a hard time because DataObject silently ignored my timestamp columns. Can't there anything be done use the values provided by the object if they're available? thanks, - Markus