Jump to content

evilbert

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

evilbert's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can someone please help me? Scenario: Database table with varying amount of records, these will be displayed on a big screen with no user interaction, updating every set amount of time say 15 seconds. Once new data enters the database the page updates and shows that record. As there is only limited space on the screen i can only show e.g 1 record per page. I setup pagination which splits these records up into separate pages. so if (isset($_GET["page"])) { $page = $_GET["page"]; } else { $page=1; }; $start_from = ($page-1) * 1; $query = "SELECT * FROM table ORDER BY id ASC LIMIT $start_from, 1"; // run the query and store the results in the $result variable. $result = $mysqli->query($query) or die(mysqli_error($mysqli)); then output the links $total_pages = ceil($total / 1); for ($i=1; $i<=$total_pages; $i++) { echo "<a href=bigscreen.php?page=".$i.">".$i."</a> "; } This is all working fine and splits the pages and displays the links. Problem: I have been trying to get the page bigscreen.php to automatically loop through the pages that are created e.g 3 records = 3 pages so i want it to load bigscreen.php?page=1 then wait for 15 seconds then update to bigscreen.php?page=2 then 15 seconds then update to bigscreen.php?page=3 then back to bigscreen.php?page=1 and this will continue to do this for the amount of pages created. I have tried various methods but i am struggling. I keep getting a redirect loop error in chrome when i setup my loop. I was thinking of putting the links into an array? but i dont know that will work! Any help or tips would be greatly appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.