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();
#2

[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....
#3

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




Theme © iAndrew 2016 - Forum software by © MyBB