Hey I try to display next row on refresh and when it arrive at last row to take it from the beginning. Here is my table
col1 row(1)
col2 row(1)
col3 row(1)
col4 row(1)
col5 row(1)
and on refresh to get
col1 row(2)
col2 row(2)
col3 row(2)
col4 row(2)
col5 row(2)
and when it arrive at last row take it from the beginning.
col1 row(1)
col2 row(1)
col3 row(1)
col4 row(1)
col5 row(1)
Here is the code so far:
<?php
include 'connect.php';
session_start();
if(isset($_SESSION["id"])){
$_SESSION["id"] = $_SESSION["id"] + 1;
}
else{
$_SESSION["id"] = 1;
}
$id = $_SESSION["id"];
//Your mysql connection
$results = mysqli_query($con, "SELECT * FROM testtable WHERE `id` = $id") or die('AM error occured: ' . mysqli_error());
while($row = mysqli_fetch_array($results)){
echo $row["content0"];
echo "<br>";
echo $row["content1"];
echo "<br>";
echo $row["content2"];
echo "<br>";
echo $row["content3"];
echo "<br>";
echo $row["content4"];
echo "<br>";
echo $row["content5"];
}