i have a table which structure contains lots of fields and one field 'booking_time' of type datetime. E.g. values of booking_time are 2015-10-04 07:33:45, 2016-07-20 17:40:00 and so on...
In my code i recieve the month and the year as two serperate integer variables (e.g 1 to 12 for months and 2015, 2016, etc. for the year). Now i need to get all table entries which have the matching year and month in the booking_time field.
How do i set up my mysql-query string to get the two numbers from the variables into the datetime format of mysql and then compare it with booking_time to get all the entries that correspond?
EDIT: My problem is the comparing of the two numbers with a mysql datetime field and not that i don't know anything about mysql queries.
Kind Regards