$sql="SELECT DISTINCT(d.slot_id),TIME_FORMAT(slot, '%h:%i %p') as slot,TIME_FORMAT(p.slot_end, '%h:%i %p') as slot_end ,d.slot_count,d.status from doc_slots d left join appoinment_slots p on d.slot_id=p.slot_id where p.app_type='MED' and slot_date=str_to_date('".$_REQUEST['slot_date']."' , '%m/%d/%Y') and d.ohc_type_id='".$_REQUEST['ohc_type_id']."' and emp_id in (select emp_id from tbl_users where FIND_IN_SET('".$role_id."',role_id) > 0 ) ";