• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I want to wildcat with active record

#1
Hello everyone,
I am using active record in codeigniter.
I want to using wildcat with query string.

This is my code

function search($search)
{
$this->db->from('items');
$this->db->like('name', $search);
return $this->db->get();
}

I want to search with key words: 1.56 TC%C-1.50
My result: all items with first word of name is "1.56 TC" and include "C-1.50"

Thanks
Reply

#2
add % at the end of your keyword like this: "1.56 TC%C-1.50%"
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.