I am using the following code to select from a MySQL database in a CodeIgniter webapp:
$query = $this->db
->get_where('mytable', array('id' => 10));
This works great, but I want to write the following MySQL statement using CI query builder methods.
SELECT *
FROM `mytable`
WHERE `id`='10' OR `field`='value'
$where = "name='Joe' AND status='boss' OR status='active'";
$this->db->where($where);