Welcome Guest, Not a member yet? Register   Sign In
Transalate RAW SQL INTO CI's active record class
#1

[eluser]sico87[/eluser]
I have this
Code:
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

Code:
$this->db
syntax, I was hoping someone would help me convert this?
#2

[eluser]flaky[/eluser]
Code:
$this->db->select('categoryId');
$this->db->where('cookieId', 'bang4b544417a41b6');
$category_list = $this->db->get('userMenuTable')->result();

$this->db->where_not_in('categoryId', $category_list);
$result = $this->db->get('categoryTable')->result_array();




Theme © iAndrew 2016 - Forum software by © MyBB