php - how to search result in codeigniter using age and cast -
this model have search result using mysql , codeigniter result searching fine show male not showing age , cast properly
public function get_selected($age, $cast) { $this->db->select('*'); $this->db->from('bride_groom_register'); $this->db->like('age', $age); $this->db->or_like('cast', $cast); $this->db->where("gender='male'"); $data = $this->db->get(); if ($data->num_rows() > 0) { return $data->result_array(); } else { return false; } }
remove like
, or_like
use inside condition. if want provide gender give in same line.
$this->db->where("age %$age% or cast %$cast%");
Comments
Post a Comment