$gateway = new EpisodeGateway();
$db = $gateway ->acces_db();
$Ermittler = array();
$Ermittler = $gateway ->get_hauptkommissar($db);
$index = 0;
$counteur = 0;
for($x=0;$x < sizeof($Ermittler);$x++)
{
echo "<strong>".$Ermittler[$x][0]."</strong>";
echo "<br>";
$result = $gateway->get_episode_by_police($db,$Ermittler[$x][0]);
}
public function get_episode_by_police($db,$Ermittler)
{
$mysqli = new mysqli($db);
$request = 'select titel,Ertaussstrahlung,stadt from folge where Ermittler=$Ermittler[0]';
$result = mysqli_query($db,'select titel,Ertaussstrahlung,stadt from folge where Ermittler= %s',$Ermittler[0]);
$result = mysqli_fetch_assoc($result);
return $result;
}
I do not know why, it is not working. I don't have any result in the variable result in the for loop. Don't be mean with me please. I'm still a beginner