Re[2]: [PHP] confused big time
| From: | Richard Davey | Date: | Wed, 07 Apr 2004 17:25:10 +0000 |
| Subject: | Re[2]: [PHP] confused big time | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-182680@lists.php.net to get a copy of this message | ||
Hello Mark,
Wednesday, April 7, 2004, 6:19:31 PM, you wrote:
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? :)
MA> Not really, since you usally format a timestamp into something thats db
MA> friendly. How many times have you written code where the date 02-01-2004
But now() IS a DB friendly format for MySQL and is the recommended way of
inserting the current time into a datetime or timestamp field.
Converting it to a timestamp/datetime locally first is a waste of
processing time IMHO and opens you up to a potential (although slight)
code error.
But, to get your function working, I can see the point :)
--
Best regards,
Richard Davey
http://www.phpcommunity.org/wiki/296.html