Welcome Guest, Not a member yet? Register   Sign In
search
#1

[eluser]Unknown[/eluser]
hey, i'm new in codeigniter.I make a search engine.My problem is i don't want to include all of the field when I start searching.if any of these fields are missing i want to return true.but i can't do this.Please help me....

here is my code
...Controller...
public function search_data()

$data=array();
$data['Category']=$this->input->post('Category', true);
$data['Country']=$this->input->post('Country', true);
$data['Mobile']=$this->input->post('Mobile1', true);
$data['Name'] =$this->input->post('Name', true);
$data['Contact']=$this->db->show_search($data);
}

....Model...

function show_search($data){

$result = '';
$this->db->select ('*');
$this->db->from ('tb');
$this->db->where ('Category',$data['Category']);
$this->db->where ('Country',$data['Country']);
$this->db->where ('Mobile',$data['Mobile']);
$this->db->where ('Name',$data['Name']);

}




Theme © iAndrew 2016 - Forum software by © MyBB