I was just wondering if there's any way to work with dates returned from a
MySQL query in PHP. Right now I do all of different stuff in my MySQL query
but it's really cumbersome, so I would like to be able to do it all with
PHP. Is there any way to do that? Thanks,

Here's my MySQL query:

$result = mysql_query("SELECT *, WEEKDAY(time0_name) AS day,
DATE_FORMAT(time0_name,'%m/%d/%y') AS print_date, DATE_FORMAT(time0_name,
'%l:%i %p') AS begin_time0, DATE_FORMAT(DATE_ADD(time0_name, INTERVAL 2
HOUR), '%l:%i %p') AS end_time0, DATE_FORMAT(time1_name, '%l:%i %p') AS
begin_time1, DATE_FORMAT(DATE_ADD(time1_name, INTERVAL 2 HOUR), '%l:%i %p')
AS end_time1, DATE_FORMAT(time2_name, '%l:%i %p') AS begin_time2,
DATE_FORMAT(DATE_ADD(time2_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time2,
DATE_FORMAT(time3_name, '%l:%i %p') AS begin_time3,
DATE_FORMAT(DATE_ADD(time3_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time3,
DATE_FORMAT(time4_name, '%l:%i %p') AS begin_time4,
DATE_FORMAT(DATE_ADD(time4_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time4,
DATE_FORMAT(time5_name, '%l:%i %p') AS begin_time5,
DATE_FORMAT(DATE_ADD(time5_name, INTERVAL 2 HOUR), '%l:%i %p') AS end_time5
FROM pickup_times",$dbh);

I could do it a lot easier if in PHP I think, so I was just wondering if
anyone could point me to a thing that talked about converting MySQL DATETIME
to PHP date stuff.

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

Reply via email to