Welcome Guest, Not a member yet? Register   Sign In
Advanced MySQL: Active Record Query not working properly?
#7

[eluser]Seppo[/eluser]
The query is wron in AR when you do this 'r.challenge_id' => 'c.id' it is using c.id as a string, not as a field...

Code:
$this->db->select('c.title, c.description, r.completion_notes, r.outcome');
$this->db->from('challenges AS c');
$this->db->join('records AS r', 'r.challenge_id = c.id');
$this->db->where(array('r.user_id' => $user_id, 'r.outcome' => 'ip'));
$this->db->limit(100, 0);
$query = $this->db->get();


Messages In This Thread
Advanced MySQL: Active Record Query not working properly? - by El Forum - 06-08-2008, 06:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB