Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2014
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.40 KB | None | 0 0
  1. public function search(){
  2.         if($this->input->post('formSearchSubmit')){
  3.             $this->form_validation->set_rules('formSearchField', 'search', 'trim|required');
  4.  
  5.             if($this->form_validation->run()){
  6.                 $this->db->like('page_title', $this->input->post('formSearchField'));
  7.                 $query = $this->db->get('ci_pages');
  8.                 foreach ($query->result() as $row){
  9.                     echo $row->page_title;
  10.                 }
  11.             }
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement