I have 2 tables
first table Actors it has
ID name_english picture link
5 Daniela Bessia 4f8ab755ed.png daniela-bessia
6 Mohannad Alarjan 14f8dfsf55ed.png mohannad-alarjan
7 Lee Tae-Im kxe3gj64.jpg lee-tae-im
second table actors_content
id content_id actors_id
1 7 5
2 5 5
3 5 6
4 5 7
Now my query is request by drama id if the visitors visit drama id number 7 ( content_id ) it should coming search on second table actors_content and select all data has content_id = 7 after select i want to make join one by one to make while for actors data without duplicate to get actors details from Actors
public function dodisplayActorsbycontent($getid){
$query = $this->db->query("SELECT `actors`.`id` , `actors`.`name_english` , `actors`.`picture` , `actors`.`link` , `actors_content`.* FROM `actors_content`, `actors` WHERE `actors_content`.`content_id` = '".$getid."'");
$total = $this->db->resultcount($query);
if($total != 0){
while($this->db->fetchrow($query)){
$list[] = $this->db->_record;
}
return($list);
}else{
return(false);
}
}