$sql = "SELECT * FROM some_table st JOIN some_other_table sot on st.sot_id = sot.id WHERE id = ? AND status = ? AND author = ?"; $this->db->query($sql, array(3, 'live', 'Rick'));