I have this
SELECT *
FROM categoryTable
WHERE categoryId NOT
IN (
SELECT categoryId
FROM userMenuTable
WHERE cookieId = 'bang4b544417a41b6'
)
but I would like it use codeigniters active record class so using
$this->db
syntax, I was hoping someone would help me convert this?
Two ways to do this:
Plain SQL:
Active Record + Plain WHERE SQL
You can put Plain SQL into a WHERE clause by adding FALSE in as the third argument in db->where();
It is a shame there is nothing neater for doing this, but Active Record is only intended for simple queries with joins, orders, limits, etc.