[eluser]nextexile[/eluser]
I'm structuring a query like so:
Code:
$this->db->where('id', $id);
foreach($makes as $make)
{
$this->db->or_like('make', $make);
}
$this->db->like('zip_codes_in_radius', $zip)
If I print it out, CI assembles it like so:
Code:
"SELECT * FROM (`submissions`) WHERE `id` = '12' AND `make` LIKE '%Chrysler%' OR `make` LIKE '%Dodge%' OR `make` LIKE '%Jeep%' OR `make` LIKE '%Ram%' AND `zip_codes_in_radius` LIKE '501%'"
The result I get makes me feel like this query is not considering the id. I want all three to be true, the id, the LIKE in make and LIKE in zip. But the result I get is often true to make and zip but not the id.