我正在尝试获取收藏夹数据
public function fav_services(){
$logged = $this->session->userdata('user_id');
$query = "SELECT * FROM `service_favorites` JOIN service ON service.sid = service_favorites.s_id WHERE uid = '$logged'";
return $this->db->query($query);
}
答案 0 :(得分:0)
我犯了一个愚蠢的错误。应该使用LEFT连接。
public function fav_services(){
$logged = $this->session->userdata('user_id');
$query = "SELECT * FROM `service_favorites` LEFT JOIN service ON service.sid = service_favorites.s_id WHERE uid = '$logged'";
return $this->db->query($query);
}