[eluser]Neil_W[/eluser]
Hello,
The manual says you can enter a customer string as the where clause. So I entered the following:
Code:
$where="parent_id=0 AND (status='$status' OR platform like '$platform%')";
$this->db->where($where);
However, the system returns an error because it is trying to put back ticks around all of the first clause, i.e.:
Code:
Unknown column 'parent_id=0' in 'where clause'
SELECT `easylink`, `name` FROM (`retro_games`) WHERE `parent_id=0` AND (status='finished' OR platform like '%') ORDER BY `name` asc
If I swap it around it seems to manage ok:
Code:
$where="(status='$status' OR platform like '%$platform%') AND parent_id=0";
$this->db->where($where);
Is there something missing?
btw, I think what's missing from the active record methods is the ability to set a flag in the WHERE, etc functions to bracket the current entry. That way I could have used the other methods to chain the where clauses together.