I have a column StartTime and EndTime in database and I'm trying to compare Date & Time from a submit in mySQL.
Here is what I've tried:
public function checksched(){
$this->db->where('employee_id', $this->input->post('employee_id'));
$this->db->where('StartTime <=', $this->input->post('StartDate').' '.$this->input->post('StartTime'));
$this->db->where('EndTime >=', $this->input->post('EndDate').' '.$this->input->post('EndTime'));
$query = $this->db->get('maintenance');
if($query->num_rows() == 1){
return false;
} else {
return true;
}
}