title: Search form with Codeigniter
body: <p>I am trying to create a search form in Codeigniter. I want to give the user 4 different options to search from. For the result I want a table that displays all 11 columns in the table I am searching from.  This is the code I have so far.</p>
  
  <p>Controller:</p>
  
  <pre><code>public function index(){
      $this-&gt;searchTest();
  }
  public function searchTest(){
      $this-&gt;load-&gt;model('reg_model');
  
  $search_term = array(
      'firstName' =&gt; $this-&gt;input-&gt;post('firstName'),
      'lastName' =&gt; $this-&gt;input-&gt;post('lastName'),
      'street' =&gt; $this-&gt;input-&gt;post('street'),
      'dob' =&gt; $this-&gt;input-&gt;post('dob'));
  
  
      $data['query'] = $this-&gt;reg_model-&gt;test($search_term);
  
  
      $this-&gt;load-&gt;view("reg_header");
      $this-&gt;load-&gt;view("reg_nav");
      $this-&gt;load-&gt;view("reg_search_form", $data);
      $this-&gt;load-&gt;view("reg_search", $data); 
  </code></pre>
  
  <p>Model:</p>
  
  <pre><code>public function test($search_term='default'){
  
  
  
     $this-&gt;db-&gt;select('*');
     $this-&gt;db-&gt;from('voterinfo');
     $this-&gt;db-&gt;like('firstName', $search_term);
     $this-&gt;db-&gt;or_like('lastName', $search_term);
     $this-&gt;db-&gt;or_like('street', $search_term);
     $this-&gt;db-&gt;or_like('dob', $search_term);
     $query = $this-&gt;db-&gt;get();
  
  
     return $query-&gt;result_array();
  </code></pre>
  
  <p>}</p>
  
  <p>View:</p>
  
  <pre><code>&lt;?php $this-&gt;load-&gt;library('table'); foreach ($query as $row){ echo $this-&gt;table-&gt;generate($row); }?&gt;
  </code></pre>