i am trying to put data of each each from my database to each page by modifying it on each page
for example i have on my database with table of :
id fname lname age
1 bob carl 23
2 michael jake 25
now i want each line to show up on each page i want
for example i have
page1.php this must out put the first line like this
bob carl 23
and i have page2.php this must out put the second line like this michael jake 25
and so on.
i have a code like this
$sql = "SELECT * FROM pages";
$results = mysqli_query($connection,$sql);
if (mysqli_num_rows($results) > 0) {
while ($row = mysqli_fetch_array($results)) {
$id = $row["id"];
$pname = $row["pname"];
$pimg = $row["pimg"];
$pstream = $row["pstream"];
}
}
if i echo this out it is gonna output the last line only or with while loop it's gonna output all lines on one page. how can i mark from my code which line should be showing ?