Re: date format help request



http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format

$result = mysql_query("SELECT field1, field2,
DATE_FORMAT('DueDate','%c.%e.%Y') FROM myTable Order by DueDate",$db);

On May 24, 11:40 pm, Moose <1...@xxxxxxxxxxx> wrote:
I have a .PhP web page that gets its results from a query like
$result = mysql_query("SELECT * FROM myTable Order by DueDate",$db);

The result includes a field with a date, which gets returned as
"2008-05-25".

What would be required to have the query return a date with the format
like "05.25.2008".

I have to figure this has to have a simple solution, but I don't know
whether to start with the MySQL database settings or by using PhP.

Thanks,

.



Relevant Pages

  • Re: Confused by mysqli
    ... When I started using MySQL with Perl back in 1998, ... fetch_assocon a query I prepared with bind variables, ... So I had it print out its eval string that it was trying to run. ... PHP will fail to run at all, because bind_result will not have enough ...
    (comp.lang.php)
  • Re: [PHP] PHP & MySQL Problem
    ... [PHP] PHP & MySQL Problem ... > actually there seems to be no problem with your query (besides that you ...
    (php.general)
  • Re: timestamp
    ... PHP newsgroup, and should be discussed in comp.databases.mysql). ... Then click on the Survey link."; ... your SQL syntax; check the manual that corresponds to your MySQL ... Your query fails because a datetime value needs to be in single quotes in the query, ...
    (comp.lang.php)
  • Re: [PHP] Architecture patterns in PHP
    ... 316 Query SHOW TABLES FROM `cake` ... 316 Query DESCRIBE `posts` ... Application and Templating Framework for PHP ... when they cache the results of reverse engineer the object model from ...
    (php.general)
  • Re: [PHP] PHP & MySQL Problem
    ... [PHP] PHP & MySQL Problem ... The query then just goes like ... >> I have a script that collects data from a form and puts together a>> mysql ...
    (php.general)