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. Quote Link to comment Share on other sites More sharing options...
Wildbug Posted July 20, 2007 Share Posted July 20, 2007 ...YEAR(pub_date) = 2007 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.