Re: how should MS Access DATETIME be handled in PHP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, April 13, 2006 9:30 am, Bing Du wrote:
>  $qry = odbtp_query("SELECT end_date,title,projectID FROM projects
> ORDER
> BY end_date DESC");

While all the data-munging in PHP is very interesting...

Might I suggest that you just use MySQL's date_format() function to
ask MySQL to give you the data you want in the first place?

Some purists would claim that the database is not the place to put
presentation logic, of course.

And for a large-scale library where other users might want to skin a
different format, I couldn't agree more.

But, really, for a small project, K.I.S.S. wins out, and having MySQL
just hand you what you want instead of cluttering up your code with
several lines (or a long multi-operation line) of PHP, seems like a
cleaner solution.

Not to mention that you'll have a lot less headaches like this one.

http://mysql.com and search for "date_format"

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux