$this->db->select('*');
$this->db->from('articles');
$this->db->join('category', 'category.id = articles.id');
$query = $this->db->get();
/* Produces: */
/* SELECT * FROM articles JOIN category ON category.id = articles.id */
$this->db->select('*');
$this->db->from('articles');
$this->db->join('category', 'category.id = articles.id');
$this->db->where(array('category.id' => 10));
$query = $this->db->get();
/* Produces: */
/* SELECT * FROM articles JOIN category ON category.id = articles.id where category.id = 10 */
$this->db->select('*');
$this->db->from('articles');
$this->db->join('category', 'category.id = articles.id');
$this->db->join('comments', 'comments.id = articles.id');
$query = $this->db->get();
/* Produces: */
/* SELECT * FROM articles */
/* JOIN category ON category.id = articles.id */
/* JOIN comments ON comments.id = articles.id */
$this->db->select('*');
$this->db->from('articles');
$this->db->join('category', 'category.id = articles.id','left');
$this->db->join('comments', 'comments.id = articles.id','left');
$query = $this->db->get();
/* Produces: */
/* SELECT * FROM articles */
/* LEFT JOIN category ON category.id = articles.id */
/* LEFT JOIN comments ON comments.id = articles.id */