Another quick question: I want to format the results of a similar query:
$Month = "SELECT Month(Date_From) from rates where Rates_ID = '$row_ID'"; $monthresult=mysql_query($Month, $connection); $m = mysql_result($monthresult,0);
This gives me 1 but I want to convert that to January, I've looked up the manual and I can only find date formatting for today's date(i.e. "F") not my date variable: $Date_From in the db.
Any suggestions for me?
BTW-Thanks Vincent I'll look up that ref now.
You could use an array:
$MonthNames = array(1=>'Jan','Feb','Mar','Apr', 'May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
and then:
$m = mysql_result($MonthNames[$monthresult],0)
yves
date_format does that:
http://www.mysql.com/doc/D/a/Date_and_time_functions.html