Imagine that there is such a base
create table monthes(month_id int, date datetime); insert into monthes values(1,'2016-08-01 00:00:00') ,(2,'2016-09-01 00:00:00') ,(3,'2016-06-01 00:00:00') ,(4,'2016-07-01 00:00:00') ;
and there is an array (in php)
$array = ['september', 'august'];
How can you select the first and second entry in this array?
here are my "attempts".
select * from monthes where DATENAME(month, `monthes.date` ) = 'september'