Welcome Guest, Not a member yet? Register   Sign In
[solved] Inner Join Active Record
#5

[eluser]a&w[/eluser]
Ok, got it resolved, was fairly close actually, but close just doesn't get it done in this case.

The query should have been:
Code:
SELECT *
FROM `table_1`
INNER JOIN `table_2` ON `table_2`.`id` = `table_1`.`id`
ORDER BY `table_1`.`id` ASC
LIMIT 25;

And to get that:
Code:
$this->db->select('*');
$this->db->from('table_1');
$this->db->join('table_2', 'table_2.id = table_1.id', 'inner');
$this->db->order_by('table_1.id', 'asc');
$this->db->limit(25, 0);


Messages In This Thread
[solved] Inner Join Active Record - by El Forum - 12-22-2008, 05:48 PM
[solved] Inner Join Active Record - by El Forum - 12-22-2008, 06:49 PM
[solved] Inner Join Active Record - by El Forum - 12-22-2008, 07:09 PM
[solved] Inner Join Active Record - by El Forum - 12-22-2008, 07:24 PM
[solved] Inner Join Active Record - by El Forum - 12-22-2008, 07:49 PM



Theme © iAndrew 2016 - Forum software by © MyBB