를이 내 모델입니다 가입 :CodeIgniter는 데이터베이스 문제
function getGalleryListing()
{
$this->db->select('photo.id,photo.src,photo.title,photo.user_id,users.id,users.username');
$this->db->from('photo');
$this->db->join('users', 'users.id = photo.user_id');
$query = $this->db->get();
return $query->result();
}
그리고 내 컨트롤러 :
function index()
{
$data['gallery_list'] = $this->Gallery_model->getGalleryListing();
$data['content'] = $this->load->view('gallery/index', $data, true);
if ($this->dx_auth->is_logged_in())
{
$this->load->view('template_login', $data);
}
else
{
$this->load->view('template', $data);
}
}
문제는, 내가 <?= $gallery->id ?>
을 수행 할 때, 대신 나에게 USERS.ID에서 ID를 보여주는 유지하다 PHOTO.ID. 내가 뭔가 빠뜨린거야? 어떤 도움을 주셔서 감사합니다.
완벽하게 감사합니다. – GeekSean
@GeekSean : 좋은 소식입니다. :) – Sarfraz