Welcome Guest, Not a member yet? Register   Sign In
CI 1.7 active record database join error
#1

[eluser]Dewos[/eluser]
Backtrick broken?

Error on CI1.7 with table.* select:
Code:
$query = $this->db->select('news.*, comments.title AS comment_title')
        ->join('comments', 'news.id = comments.news_id', 'left')
        ->from($this->table)
        ->get();
                          
        return $query->row();

For Fix:
Code:
$query = $this->db->select('news.*', FALSE)
                ->select('comments.title AS comment_title')
        ->join('comments', 'news.id = comments.news_id', 'left')
        ->from($this->table)
        ->get();
                          
        return $query->row();


Messages In This Thread
CI 1.7 active record database join error - by El Forum - 10-26-2008, 09:58 AM
CI 1.7 active record database join error - by El Forum - 10-26-2008, 10:27 AM
CI 1.7 active record database join error - by El Forum - 10-26-2008, 10:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB