If you have 2 records the first one id = 1, second id = 2
while ($query->fetch()) {
$_SESSION['id'] = $id ;
//First loop $_SESSION['id'] = 1
//second loop $_SESSION['id'] = 2
$_SESSION['title'] = $title ;
<a href="deletenews.php">
}
// at the end $_SESSION['id'] = 2
What you want to do is
while ($query->fetch()) {
<a href="deletenews.php?id=$id&title=$title">
//it will link the link ;) with the id of the news
}
The changes in delete.php will be :
$id = $_GET['id'];
$title = $_GET['title'];
have fun