RE: [PHP-DB] displaying a MySQL date in a different format

2003-01-07 Thread John W. Holmes
[snip] In a receipt to the customer you might want to show them their date of order and other information using: $query=SELECT DATE_FORMAT(o.date, '%m/%d/%Y'), it.cost FROM order o, item it WHERE cust_id = $custId; To

RE: [PHP-DB] displaying a MySQL date in a different format

2003-01-06 Thread Bernain, Fernando G.
I dont know if its the best solution, but I made a function that cut the date: function sqldate($fecha) { $dia=substr($fecha,0,2); $mes=substr($fecha,3,2); $anio=substr($fecha,6,4); $fechasql=$anio./.$mes./.$dia; return $fechasql;

Re: [PHP-DB] displaying a MySQL date in a different format

2003-01-04 Thread Jeffrey_N_Dyke
SELECT DATE_FORMAT(NOW(), '%m/%d/%Y'); will out put 01/04/2003. replace NOW() with you're column name. check out hte mysql manual for all of the date variations. hth jeff