Re: confused big time
| From: | Mark Ackroyd | Date: | Wed, 07 Apr 2004 17:19:31 +0000 |
| Subject: | Re: confused big time | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182678@lists.php.net to get a copy of this message | ||
RD> That .1% of the time being when you need to insert a value as now() ?
RD> (which will break the string check as it'll wrap it with '' which will
RD> cause MySQL to insert 0000-00-00 00:00:00) or if it's an enum field
RD> with a numeric allowed value? :)
Not really, since you usally format a timestamp into something thats db friendly. How many times have you written code where the date 02-01-2004 means the 2nd of Jan or the 1st of Feb?. On a MS SQL BOX the best format is '01-MAR-2004 12:00:00' which is eval'ed as a string. On mysql it's '2004-03-01 12:00:00' if you get into the habbit of *always* converting the date into a db friendly string, then you'll never have date insert problems and it can be used in the function without issues.
Mark