I want to check two values with one Column of database in codeigniter. There is 'add_date' column in database I want to check values coming from $daterange variable with 'add_date' Column. The $daterange variable is split into array by using $array = explode(' ', $daterange);
Now I want to check the 'add_date' column with first index of $array and also with second index of $array. But the $where does not gives actual value.
public function get_reports() {
if ($this - > input - > post()) { //If Any Values Posted
if ($this - > input - > is_ajax_request()) { //If Request Generated From Ajax
//Getting Posted Values
$daterange = $this - > input - > post('daterange');
$array = explode(' ', $daterange);
$where = array(
'add_date' > $array[0],
'add_date' < $array[1]
);
$this - > data['sales'] = $this - > Common_model - > select_fields_where_like_join("add_sales", "*", '', $where);
$this - > show('reports/sales_reports', $this - > data);
}
}
}