Welcome Guest, Not a member yet? Register   Sign In
Using joins?
#1

[eluser]chefnelone[/eluser]
Hello,

I'm usign this active record(which works fine):

Code:
$this->db->join('categories', 'categories.id_category = products.category_id'  , 'left');


but... I need to join categories based in the value of $category_id instead of based in the value of of the field: products.category_id.

Something like: (not working)
Code:
$category_id = 228;
$this->db->join('categories', 'categories.id_category = '.$category_id , 'left');


I know I've got a problem with logic of the tables and I'll have to make some changes with them... but I need to solve this now.
Any ideas?
Thanks


Messages In This Thread
Using joins? - by El Forum - 09-03-2010, 03:16 AM
Using joins? - by El Forum - 09-03-2010, 03:41 AM
Using joins? - by El Forum - 09-03-2010, 03:46 AM
Using joins? - by El Forum - 09-03-2010, 03:50 AM



Theme © iAndrew 2016 - Forum software by © MyBB