<!DOCTYPE html>
<html>

    <head>

    </head>

    <body>

        <?php
            $q = intval($_GET['q']);
            // connexion a la base
            $db = mysqli_connect('localhost', 'root', 'm148r43a9Y@%Z','smartpassTest2');
               
            if(!$db){
                die("Erreur de connection :" .mysqli_error($db));
            }

            // selection de la base 
            mysqli_select_db($db, "ajax_demo");
            //Requete SQL
            $strSQL = "SELECT * FROM InformationsGenerales WHERE id = '".$q."'";
            $result = mysqli_query($db, $strSQL);

            if(mysqli_num_rows($result) == 0){
              echo "<p>Aucun champ ! '".$q."' </p>";
            }

            while($resultat = mysqli_fetch_array($result)){
                echo "<p id = ". $resultat["id"] ." >||". $resultat["Lattitude"] ."||". $resultat["Longitude"] ."||</p>";
            }

            //Obtenir le titre et le sous-titre du point
            $strSQL2 = "SELECT * FROM DescriptionGenerale WHERE id = '".$q."'";
            $result2 = mysqli_query($db, $strSQL2);
                        
            while($resultat2 = mysqli_fetch_array($result2)){
                echo "<p id = ". $resultat2["id"] ." > ||". $resultat2["Titre"] ."||". $resultat2["Soustitre"] ."||</p>";
            }        
            mysqli_close($db);
        ?>
    </body>
</html>