hi all happy new year to all.
i am having a date field with (Y-m-d) format say (2014-12-31)
need to know how i can mysql query (Y-m) say (2014-12) meaning all rows in table should display for the whole month
any help will be much appreciated.
mysql query in php date format
Moderator: General Moderators
Re: mysql query in php date format
You could easily use BETWEEN.
Re: mysql query in php date format
You can use one of the mysql date functions as date_format() or extract()
http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format
http://dev.mysql.com/doc/refman/5.1/en/ ... on_extract
http://dev.mysql.com/doc/refman/5.1/en/ ... ate-format
http://dev.mysql.com/doc/refman/5.1/en/ ... on_extract