$query = "select * from researchsub_form where flag='1' and date between '$date' and '$date1' ";
I have two input, date and date1, I have to show the data from database between the date ‘date’ and ‘date1′ of flag=’1’, for this I use a SQL query, but I want to show the data when I enter only one date input which is either ‘date’ or ‘date1’
select * from researchsub_form where flag=’1′ and (date between ‘$date’ and ‘$date1′ or date=’$date’ or date=’$date1′)