Visualizzazione dei risultati da 1 a 9 su 9

Hybrid View

  1. #1
    Moderatore di PHP L'avatar di Alhazred
    Registrato dal
    Oct 2003
    Messaggi
    12,509
    Qui
    <a href=\"film_detail.php?\">

    modifica in
    <a href=\"film_detail.php?titre={$row["titre"]}\">

    In pagina2.php lo recuperi con $_GET['titre']

    In questo modo puoi avere qualche problema in caso di caratteri speciali o spazi, se hai un id numerico associato ai film, ti conviene passare quello e recuperare solo il film che ti interessa in pagina2.php usando tale id.

  2. #2
    Utente di HTML.it
    Registrato dal
    Oct 2017
    Messaggi
    3
    Quote Originariamente inviata da Alhazred Visualizza il messaggio
    Qui
    <a href=\"film_detail.php?\">

    modifica in
    <a href=\"film_detail.php?titre={$row["titre"]}\">

    In pagina2.php lo recuperi con $_GET['titre']

    In questo modo puoi avere qualche problema in caso di caratteri speciali o spazi, se hai un id numerico associato ai film, ti conviene passare quello e recuperare solo il film che ti interessa in pagina2.php usando tale id.

    GRAZIE per la pronta risposta, ho provato a modificare come dici tu ma nella seconda pagina non mi stampa nulla, ecco le mie modifiche:

    PAGINA 1:

    $query = "SELECT titre, nom_multiplex, date, horaire, nb_salle, nom_region, genre
    FROM Film, Multiplex, Seance, Region, Genre, a_un_genre
    WHERE a_un_genre.genreID=Genre.genreID
    AND a_un_genre.filmID=Film.filmID
    AND Seance.filmID=Film.filmID
    AND Seance.multiplexID=Multiplex.multiplexID
    AND Multiplex.regionID=Region.regionID
    $region $genre
    AND titre LIKE '%$search%'
    GROUP BY Seance.seanceID
    ORDER BY Seance.date";


    //eseguo la query
    $result = mysqli_query($mysqli, $query) or die('Errore query') ;
    //stampo i risultati a schermo, dentro a una tabella


    echo "<table align=center>";
    echo "<thead>";
    echo "<tr>";
    echo "<th><h3>Titre</h3></th>";
    echo "<th><h3>Multiplex</h3></th>";
    echo "<th><h3>Date</h3></th>";
    echo "<th><h3>Horaire</h3></th>";
    echo "<th><h3>Salle</h3></th>";
    echo "<th><h3>Région</h3></th>";
    echo "</tr>";
    echo "</thead>";


    while ($row = mysqli_fetch_assoc($result)) {
    echo "<tr align=center>";
    echo "<th><h4><a href=\"film_detail.php?titre={$row["filmID"]}\">{$row["titre"]}</a></h4></th>";
    echo "<th><h4><a href=\"multiplex_detail.php\">{$row["nom_multiplex"]}</a></h4></th>";
    echo "<th><h4>{$row["date"]}</h4></th>";
    echo "<th><h4>{$row["horaire"]}</h4></th>";
    echo "<th><h4>{$row["nb_salle"]}</h4></th>";
    echo "<th><h4>{$row["nom_region"]}</h4></th>";
    echo "</tr>";
    }
    echo "</table>";


    ?>

    PAGINA 2:

    $titre = $_GET['filmID']

    $mysqli = new mysqli("$host", "$user", "$password", "$db");

    $query = "SELECT titre, genre, age_legal, duree, 3D, nom_realisateur, bande_annonce
    FROM Film, Genre, a_un_genre, Realisateur, realise
    WHERE a_un_genre.genreID=Genre.genreID
    AND a_un_genre.filmID=Film.filmID
    AND realise.filmID=Film.filmID
    AND realise.realisateurID=Realisateur.realisateurID
    AND Film.filmID = "$titre" ";



    $result = mysqli_query($mysqli, $query) or die('Errore query') ;



    echo "<table align=center>";
    echo "<thead>";
    echo "<tr>";
    echo "<th><h3>Titre</h3></th>";
    echo "<th><h3>Genre</h3></th>";
    echo "<th><h3>Âge légal</h3></th>";
    echo "<th><h3>Durée</h3></th>";
    echo "<th><h3>3D</h3></th>";
    echo "<th><h3>Réalisateur</h3></th>";
    echo "<th><h3>Trailer</h3></th>";
    echo "</tr>";
    echo "</thead>";
    while ($row = mysqli_fetch_assoc($result)) {
    echo "<tr align=center>";
    echo "<th><h4>{$row["titre"]}</h4></th>";
    echo "<th><h4>{$row["genre"]}</h4></th>";
    echo "<th><h4>{$row["age_legal"]}</h4></th>";
    echo "<th><h4>{$row["duree"]}</h4></th>";
    echo "<th><h4>{$row["3D"]}</h4></th>";
    echo "<th><h4>{$row["nom_realisateur"]}</h4></th>";
    echo "<th><h4><a href=\"{$row["bande_annonce"]}\">voir bande d'annonce</a></h4></th>";
    echo "</tr>";
    }
    echo "</table>";


    ?>

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.