Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB