date_time formatted query returning empty
Posted: Fri Jan 12, 2007 6:22 pm
I have a MySQL database, with a table including a datetime type field called "publishdate".
When I run this query:
I get "invalid query: Query was empty"
When I run it without the date_format:
It returns fine. But I'd like to take advantage of the date formatting capabilities of MySQL, rather than using a page-level function.
This is on a dedicated server my client set up. Is it possible something is wrong with the MySQL or PHP install?
I'm at a loss.
When I run this query:
Code: Select all
$releasesQuery = sprintf("select date_format(publishdate, '%a %D %b %Y') as formatted_date from newsreleases;");When I run it without the date_format:
Code: Select all
$releasesQuery = sprintf("select publishdate as formatted_date from newsreleases;");This is on a dedicated server my client set up. Is it possible something is wrong with the MySQL or PHP install?
I'm at a loss.