Search form with Codeigniter Search form with Codeigniter codeigniter codeigniter

Search form with Codeigniter


If you want to put in table using codeigniter table class , it should be something like this:

$this->load->library('table');$this->table->set_heading(array('Name', 'Color', 'Size')); //your column nameforeach($query as $row ){   $this->table->add_row($row);}echo $this->table->generate(); 

you need also to modify your model. You're query is wrong you forgot the key , it should be like this:

public function test($search_term='default'){   $this->db->select('*');   $this->db->from('voterinfo');   $this->db->like('firstName', $search_term['firstName']);   $this->db->or_like('lastName', $search_term['lastName']);   $this->db->or_like('street', $search_term['street']);   $this->db->or_like('dob', $search_term['dob']);   $query = $this->db->get();   return $query->result_array();}