I'm showing a data table from MySQL, let say in x.php like
<?php $sql = "SELECT * FROM tblname";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$id=$row["id"];
echo "<tr><td>". $row["0"]. "</td><td>". $row["1"]."</td><td>".$row["2"]."</td><td>".$row["3"]."</td><td>"."<a href='y.php?=$id'>More details</a>"."</td></tr>";
$_SESSION["id"]=$id;
}
} else {
}?>
But where I go to y.php class to see more details it shows data only from last row of MySQL records. How can I fix it?