i want same code with switch case. if($fromdate && $todate) { /* Search by Only By Date*/ $sql="SELECT * FROM child_information INNER JOIN gurdian_information ON gurdian_information.patient_id=child_information.patient_id where (child_information.date between ‘$fromdate’ and ‘$todate’) "; } elseif($status)