1
I have two tables:
- the first is temporadas, that hold only the name of the season. Example:Primeira Temporada,Segunda Temporada, etc..
- I have another table that holds each episode for its season.
The episodes are shown in a accordion effect, the name Primeira Temporada is the link of the accordion effect, there I have the div conteudo that will hold the episodios for each season.
What I’m struggling with is showing each episode in its season on the accordion effect.
I don’t pass the
id_temporadain 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 }?>
I deleted my comment since you solved that.
– Victor Eyer
Why don’t you use the id_serie in your query?
– Victor Eyer
@VWE the
id_serieis auto increment, which corresponds to the season is theid_temporada, if you want I can put the structures of my tables– goio