Re: If date is greater than
| From: | German Geek | Date: | Tue, 22 Oct 2013 05:40:11 +0000 |
| Subject: | Re: If date is greater than | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322349@lists.php.net to get a copy of this message | ||
if you are connected to the db already and the dates in question are in a
table, i agree, using the dbms functions is faster/easier than php.
but if you do not have a connection to the db php is faster.
Tim-Hinnerk Heuer
Twitter: @geekdenz
Blog: http://www.thheuer.com
On 21 October 2013 04:50, Tedd Sperling <tedd.sperling@gmail.com> wrote:
>
> On Oct 20, 2013, at 4:01 AM, Ashley Sheridan <ash@ashleysheridan.co.uk>
> wrote:
>
> > Yes, I was going to ask, why are you storing your dates as strings?
> > MySQL has a perfectly good DATE type. It's also generally faster
> > comparing dates within a MySQL query than PHP code.
> >
> > Thanks,
> > Ash
> > http://www.ashleysheridan.co.uk
>
> Agreed.
>
> Plus, there are many date functions provided by MySQL that are easier
> (possibility faster) than what you can do in PHP.
>
> Check these out:
>
>
>
> http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_date
>
> tedd
>
> _______________
> tedd sperling
> tedd.sperling@gmail.com
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>