In the site that I am creating presents in a page all the news with 1 dynamic link that this creates a page with the content of this news however all generated links will always stop to the first value of the database and not to the ID that is intended. Someone can help me? Thank you.
Page to generate links
Page of any displayed link shows only the first value of the table.
if(isset($_GET['id'])){
$ID = mysqli_real_escape_string($db, $_GET['id']);
$db = mysqli_connect("localhost", "root", "root", "base_de_dados_museu");
$sql = "SELECT * FROM destaques where id='$ID'";
$result = mysqli_query($db, $sql) or die ("bad query: $sql");
$row = mysqli_fetch_array($result);
$result = mysqli_query($db, $sql) or die ("bad query: $sql");
if(isset($_GET['post'])){
$titulo = mysqli_real_escape_string($db, $_GET['titulo']);
$image = mysqli_real_escape_string($db, $_GET['image']);
$texto = mysqli_real_escape_string($db, $_GET['texto']);
$sql = "INSERT INTO destaques (id, titulo, texto, image) VALUES ('$titulo', '$image', '$texto')";
$result = mysqli_query($db, $sql) or die ("bad query: $sql");
}
}