Welcome Guest, Not a member yet? Register   Sign In
Is this a LEFT join by default ?
#2

[eluser]PhilTem[/eluser]
From the user's guide

Quote:$this->db->join();
Permits you to write the JOIN portion of your query:
Code:
$this->db->select('*');
$this->db->from('blogs');
$this->db->join('comments', 'comments.id = blogs.id');

$query = $this->db->get();

// Produces:
// SELECT * FROM blogs
// JOIN comments ON comments.id = blogs.id

Multiple function calls can be made if you need several joins in one query.

If you need a specific type of JOIN you can specify it via the third parameter of the function. Options are: left, right, outer, inner, left outer, and right outer.
Code:
$this->db->join('comments', 'comments.id = blogs.id', 'left');

// Produces: LEFT JOIN comments ON comments.id = blogs.id


Messages In This Thread
Is this a LEFT join by default ? - by El Forum - 01-23-2013, 11:04 AM
Is this a LEFT join by default ? - by El Forum - 01-23-2013, 11:40 AM
Is this a LEFT join by default ? - by El Forum - 01-23-2013, 12:39 PM



Theme © iAndrew 2016 - Forum software by © MyBB