I'm trying to select records by the year from a mktime() stamp in the database. I thought I could do it this way:
$new_date = "2006";
$query = "select date, DATE_FORMAT(date,'%Y') AS year from articles where year = $new_date";
But I'm doing something wrong and haven't been able to figure out what it is. 2 hours of reading documentation and I'm missing something.
Can someone help me out with this query? Thanks.