Code: Select all
SELECT review_id, firms_name
FROM reviews AS r
JOIN firms AS f ON f.firms_id = r.review_target_id
WHERE r.review_id =3
ORDER BY r.review_timestamp DESC
LIMIT 0 , 30
Dadurch erhalte ich jedoch nur eine Spalte, „review_id“:
Code: Select all
$this->db->select('review_id', 'firms_name');
$this->db->from('reviews as r');
$this->db->join('firms as f', 'f.firms_id = r.review_target_id');
$this->db->where('r.review_id', $id);
$this->db->order_by('r.review_timestamp', 'desc');
$query = $this->db->get();
Mobile version