Welcome Guest, Not a member yet? Register   Sign In
SQL Join
#5

[eluser]iainco[/eluser]
Hi Randy, thanks for your help.

Code:
function fetchFeeds($categoryID)
{
    $this->db->select('feed.ID, feed.title, user_feed.feedID');
    $this->db->from('feed');
    $this->db->join('user_feed', 'user_feed.feedID = feed.ID AND user_feed.userID = ' . $this->session->userdata('ID'), 'left');
    $this->db->where('feed.categoryID', $categoryID);

    return $this->db->get()->result_array();
}

I found this to work exactly as I need it to... but it doesn't match with what you said.

Thanks


Messages In This Thread
SQL Join - by El Forum - 08-21-2008, 07:35 AM
SQL Join - by El Forum - 08-21-2008, 08:11 AM
SQL Join - by El Forum - 08-21-2008, 08:27 AM
SQL Join - by El Forum - 08-21-2008, 09:55 AM
SQL Join - by El Forum - 08-21-2008, 10:23 AM
SQL Join - by El Forum - 08-21-2008, 10:48 AM
SQL Join - by El Forum - 08-21-2008, 01:03 PM
SQL Join - by El Forum - 08-21-2008, 01:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB