I’m working on a CMS with CodeIgniter and I would like to make an exception with my SQL query
function get_categories()
{
$query = $this->db->get('ft_categories');
return $query->result();
}
This function will get every categories in my TABLE and I want to remove something from this result
Example :
I get this : CAT1 – CAT2 – CAT3 – SPECIALCAT from the query and I would like to remove the SPECIALCAT from the result by the name of this CAT
Is it possible? How can I do that?
You can use either:
or
These assume that your field name is “CAT” and the value of the category you want to avoid retrieving is “SPECIALCAT”. They’re equivalent statements just slightly different formatting. See http://codeigniter.com/user_guide/database/active_record.html for more info.