Re: something about dates in mysql
| From: | Florin Jurcovici | Date: | Fri, 04 Mar 2011 18:54:13 +0000 |
| Subject: | Re: something about dates in mysql | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-311670@lists.php.net to get a copy of this message | ||
Why don't you use mysqli or PDO, when passing dates as parameters?
If it's just about the right SQL, you _should_ actually use dates as
strings - this is how mysql is able to handle them properly. However,
you absolutely need to use a format of 'yyyy-mm-dd', or else MySQL may
fail on interpreting them properly.
(Had a similar problem recently, that's how I came to remember this.)