Welcome Guest, Not a member yet? Register   Sign In
translating one query in Active record CI to ordinary sql
#2

[eluser]pickupman[/eluser]
You can pass a WHERE statement as a string. Using implode to combine your cities into a string.
Code:
$city_where = implode("' OR x.id = '", $citites); // create string from array
$city_where = ltrim($city_where, "' OR"); // trim first OR from the implode
$this->db->where('(' . $city_where .')');

Probably need to tweak a bit, but this should get you close.


Messages In This Thread
translating one query in Active record CI to ordinary sql - by El Forum - 05-04-2013, 09:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB