php - Find the number of entries between two dates -
i building online hotel booking system , using php , mysql . in database scheme , table bookings refers booking dates .
the below shows entries of bookings table :-
id id_item the_date 1 1 2014-03-25 2 1 2014-03-26 3 1 2014-03-27 4 1 2014-03-25 5 2 2014-03-02 6 2 2014-03-02 7 3 2014-03-25 8 1 2014-03-26 9 1 2014-03-27
in table , id_item
shows room category .in id_item 1
there 2 rooms.
in id_item=1
there 2 entries in between 25-03-2014 27-03-2014
.so 2 rooms booked .
i want calculate how many number of entries in bookings
"where id_item =1 , the_date between 25-03-2014 , 27-03-2014 ".
select count(id) bookings id_item = 1 , the_date between '2014-03-25' , '2014-03-27'
Comments
Post a Comment