Welcome Guest, Not a member yet? Register   Sign In
Referencing or linking mysql tables
#3

[eluser]sanir[/eluser]
Use join for that.

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

Thanks,
Nasir Ranta


Messages In This Thread
Referencing or linking mysql tables - by El Forum - 05-30-2012, 01:03 AM
Referencing or linking mysql tables - by El Forum - 05-30-2012, 03:06 AM
Referencing or linking mysql tables - by El Forum - 05-30-2012, 04:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB