Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function search_prd()
- {
- $query=$this->input->post();
- $this->load->model('prd/addprd');
- $prd_search=$this->addprd->prd_search($query);
- $this->load->view('prd_search',['prd_search'=>$prd_search]);
- }
- function prd_search($query)
- {
- $q= $this->db->from('purchase')
- ->like('item_name',$query)
- ->get();
- return $q->num_rows();
- }
- <input name="search_value">
- $query = $this->input->post('search_value'); //notate the field being used here
- $this->db->like('column', $query); //query is now a string
- $this->db->where_in('column', $query); //if you assign $query to $this->input->post();
Add Comment
Please, Sign In to add comment