jason97673 Posted July 20, 2007 Share Posted July 20, 2007 Hello, in PHP, I am creating a query trying to select * from the database where pub_date = year 2007 What would be the correct syntax for this MySQL statement? I have something like that SELECT *, substring( description, 1, 200 ) as short_description FROM books order by title ASC where pub_date = 2007/00/00 In the DB, the pub_date field is set to the date type. But it doesn't work, query fails. Any help? Thanks. Link to comment https://forums.phpfreaks.com/topic/60970-selecting-everything-from-2007/ Share on other sites More sharing options...
Wildbug Posted July 20, 2007 Share Posted July 20, 2007 ...YEAR(pub_date) = 2007 Link to comment https://forums.phpfreaks.com/topic/60970-selecting-everything-from-2007/#findComment-303488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.