Please help.
help with date retrieval from mysql onto a php page
Moderator: General Moderators
help with date retrieval from mysql onto a php page
whats the best/easiest way to retrieve a date from mysql onto a php page, but having it displayed in european date display. eg dd-mm-yyyy
Please help.
Please help.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
When you retrieve the data from the database use MySQL's DATE_FORMAT function:
MySQL Date and Time Functions
Mac
Code: Select all
SELECT field1, field2, DATE_FORMAT(date_field, '%d-%m-%Y') AS date FROM tableMac
thanks, it is a slightly more complex scenario. Please see
If you look at the query string below you will see that first of all i need to take the max value from that column and then apply the change. Unfortunately the code below does not work.
Any suggestions?
select DATE_FORMAT(MAX(real_date), '%d-%m-%Y') as homeLast from bulletins
Thanks[/b]
Any suggestions?
select DATE_FORMAT(MAX(real_date), '%d-%m-%Y') as homeLast from bulletins
Thanks[/b]