从MySQL中选择特定年份

I have column which name is date. This column's format is like D/M/Y (14/11/2016). I just want to select 2016 year. How can I do?

I'm using this code right now, what must I add?

mysql_query("SELECT * FROM blog ORDER BY id DESC");

Your query could be:

"SELECT * FROM blog WHERE YEAR(date)='2016' ORDER BY id DESC";

if your date column is a date data type. But since you are not using the standard mysql date format (YYYY-MM-DD) I guess it is not.

Please note that you are using a deprecated MYSQL_* API and you should switch to MYSQLI or PDO

I would advise you to not use mysql_query and switch to PDO or MySQLi instead but as per your problem:

 mysql_query("SELECT * FROM blog WHERE YEAR(Date) = 2016 ORDER BY id DESC")
mysql_query("SELECT * FROM blog WHERE YEAR(Date) = 2016 ORDER BY id DESC");

or

mysql_query("SELECT * FROM blog WHERE date >= "00/00/2016" AND date <= "31/12/2016" ORDER BY id DESC");

or

mysql_query("SELECT DATE_FORMAT(date, '%d %m %Y') AS your_date FROM blog WHERE your_date LIKE "%2016" ORDER BY id DESC");

try this code:

SELECT YEAR(STR_TO_DATE('14/11/2016', '%d/%m/%Y'));