Anyone can point me out on how make php mysql proceed to the next row of table?
Example, I got a table:
ID First Name Last Name
01 Testing Testing
02 Testing1 Testing1
In order for me to display the first data, I will have use below code:
$sql = "SELECT * FROM MyGuests WHERE ID = 01";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo "id: " . $row["id"]. " - Name: " . $row["firstname"]. " " . $row["lastname"]. "<br>";
}
}
Now, my question is, how can I automatically display the next row or the 02 and rest of the row after I have called ID 01? I believe there's a specific code I will have to use in order to do this. If not, kindly point me on the right way. Thanks in advance.