Welcome Guest, Not a member yet? Register   Sign In
$this->db->like
#4

[eluser]Référencement Google[/eluser]
The query will return all results that correspond to the WHERE string, but using where assume that your field contains only the searched string, you can not use a WHERE query for searching in a piece of text for example.

Assuming you work with a model, you'll have to return it with something like:
Code:
function find_string($string = FALSE)
{
    $this->db->where('somefield', $string);
    $query = $this->db->get('table');
    return $query->result();
}

Also, I am not sure I get what you really want to do, it will be good if you explain more because if you want to search a piece of text in a field for an exact match, of course don't use a WHERE query.

If you have problems, please post your code so we can better help you.


Messages In This Thread
$this->db->like - by El Forum - 07-15-2008, 05:52 AM
$this->db->like - by El Forum - 07-15-2008, 06:00 AM
$this->db->like - by El Forum - 07-15-2008, 06:19 AM
$this->db->like - by El Forum - 07-15-2008, 07:45 AM
$this->db->like - by El Forum - 07-16-2008, 02:02 AM
$this->db->like - by El Forum - 07-16-2008, 03:30 AM
$this->db->like - by El Forum - 07-16-2008, 03:38 AM
$this->db->like - by El Forum - 07-16-2008, 04:46 AM
$this->db->like - by El Forum - 07-16-2008, 04:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB