my brain decided to switch off today. I need a bit of help.
I have the following:
I have a date field in a table which records the following information:
YYYY-MM-DD
I have the following query to snag only the year:
$sql = "SELECT DISTINCT year(dte) FROM tbl ORDER BY dte DESC";
I need to parse out just the year and display it in a drop down. The following does not work for some reason:
while ($row = mysql_fetch_array($sql_result)) {
$dte = $row["dte"];
echo "
<option value=\"$dte\">$dte</option>
";
}
can anyone tell me why?