Original:
$sql = "SELECT DATE(TimeAdded) AS Date, $column_name FROM Codes ORDER BY TimeAdded ASC";
Altered:
$sql = "SELECT DATE("m", TimeAdded ) AS Date, ColumnName FROM TableName ORDER BY TimeAdded ASC";
TimeAdded was added using NOW() and basically, I am trying to make it months. The problem I have here is the quotations is messing it up. I tried using \ to get rid it but no good. Also tried this:
mysql_real_escape_string( DATE("m", TimeAdded ) )
More info: http://php.net/manual/en/function.date.php The date function uses m to format in months. It's a function from PHP, I think.
Update: I mixed the data() for php with mysql, no wonder!