PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
SELECT field1, field2, field3, YEAR(date_field) AS date_field_year FROM table
It is good practise to specify which fields you wish to return from the table. It is also a good idea to not put user inputted data directly into a query without validating it first.
If you are unsure whether your code is correct does that mean that it is not doing what you expect?