Re: Displaying Date from Value in MySQL DB

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

 



From: "Justin @ Dreaming in TO" <justin@xxxxxxxxxxxxxxxx>

> SELECT ditoevents.eventstatus, ditoevents.eventdate,
> DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y'), ditoevents.eventtime,
> ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
> FROM ditoevents
> WHERE ditoevents.eventstatus = 'next'

Use an alias:

SELECT ditoevents.eventstatus, ditoevents.eventdate,
DATE_FORMAT(ditoevents.eventdate, '%a, %b %d %Y') AS myformatteddate,
ditoevents.eventtime,
ditoevents.eventlocation, ditoevents.topic, ditoevents.presenter
FROM ditoevents
WHERE ditoevents.eventstatus = 'next'

Then display $row['myformatteddate'] when you're displaying the data.

---John Holmes...

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux