I want to combine AND OR mysql queries in CI. I have already seen this thread: http://codeigniter.com/forums/viewthread/92818/.
But they don\'t provide the exact solution th
In Codeigniter we can use like this it easy to understand.
$sql = "SELECT
*
FROM
`Persons`
WHERE
LastName = 'Svendson'
AND Age = '12'
AND (
FirstName = 'Tove'
OR FirstName = 'Ola'
OR Gender = 'M'
OR Country = 'India'
)";
$query = $this->db->query($sql);
return $query->result();