CodeIgniter Forums
CI 1.7 active record database join error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: CI 1.7 active record database join error (/showthread.php?tid=12640)



CI 1.7 active record database join error - El Forum - 10-26-2008

[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();



CI 1.7 active record database join error - El Forum - 10-26-2008

[eluser]Velizar N.[/eluser]
[quote author="Dewos" date="1225054738"]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();
[/quote]


Yes, unfortunately the new Database classes have too many crucial updates....


CI 1.7 active record database join error - El Forum - 10-26-2008

[eluser]Dewos[/eluser]
I think so, thanks for the reply Velizar.