Это мой настоящий запрос:
Код: Выделить всё
$this->db->select('p.id, p.photo, p.desc, info.desc');
$this->db->from('products as p');
$this->db->join('lang_info as info', 'info.id=p.id and info.name=\'good\' info.lang='.$this->lang, 'left');
$this->db->join('lang_info as info2', 'info2.id=p.id and and info2.name=\'bad\' info2.lang='.$this->lang, 'left');
$this->db->where('p.id', $this->product_id);
Код: Выделить всё
$this->db->where('info.lang', $this->lang);
$this->db->where('info2.lang', $this->lang);
Подробнее здесь: https://stackoverflow.com/questions/383 ... -on-clause
Мобильная версия