Display contents of two tables in an accordion referring to your ID

1

I have two tables:

  • the first is temporadas , which holds only the name of the season. Example: Primeira Temporada , Segunda Temporada , etc.
  • I have another table that holds each episode for your season.

The episodes are displayed in an accordion effect, the name Primeira Temporada is the link of the concertina effect, there I have the conteudo div that will hold the episodios for each season.

What I'm having trouble with is displaying each episode of your concert season.

  

I do not pass the id_temporada on the URL

<?php   
$url = explode("/",$_GET['url'],-1);
$url = $url[1];
if(isset($_GET['id_serie'])){
    $id_serie = $_GET['id_serie'];
}
$temporada = "SELECT * FROM temporadas WHERE id_serie = '$url' AND audio = 'Dublado'";
$temporadaShow = mysqli_query($conn,$temporada);
while($show = mysqli_fetch_assoc($temporadaShow)){  
?>
    <div class="caixa align_left">
    <!-- Exibo o nome da temporada -->
    <a href="javascript:void(0)" class="titulo" id="<?php echo $show['id_temporada'];?>">
         <?php echo $show['temporada_serie'];?>
    </a>
    <!-- div que vai segurar os episodio no meu efeito sanfona -->
    <div class="conteudo hide" id="<?php echo $show['id_temporada'];?>">    
        <?php
            if(isset($_GET['id_temporada'])){
                $id_temporada = $_GET['id_temporada'];
            }
            $episodio = "SELECT * FROM episodios WHERE id_temporada = '$id_temporada' AND audio = 'Dublado'";
            $episodioShow = mysqli_query($conn,$episodio);
            while($show = mysqli_fetch_assoc($episodioShow)){
                 echo "aqui eu exibiria o episodio";
            }
        ?>
    </div>
</div>
<?php }?>
    
asked by anonymous 09.07.2018 / 21:35

0 answers