Guest User

Untitled

a guest
Aug 16th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. function search_prd()
  2. {
  3. $query=$this->input->post();
  4. $this->load->model('prd/addprd');
  5. $prd_search=$this->addprd->prd_search($query);
  6. $this->load->view('prd_search',['prd_search'=>$prd_search]);
  7. }
  8.  
  9. function prd_search($query)
  10. {
  11. $q= $this->db->from('purchase')
  12. ->like('item_name',$query)
  13. ->get();
  14. return $q->num_rows();
  15. }
  16.  
  17. <input name="search_value">
  18.  
  19. $query = $this->input->post('search_value'); //notate the field being used here
  20.  
  21. $this->db->like('column', $query); //query is now a string
  22.  
  23. $this->db->where_in('column', $query); //if you assign $query to $this->input->post();
Add Comment
Please, Sign In to add comment