简体   繁体   中英

PHP table display from database airport board

I am looking for a way to display my table in such way that it display certain amount of records in the database and after few seconds it move to next page to display other records.

Let's say I want to display table from database have 20 record but I want to show only 10 records and after sometimes page move or like animation to second page show the rest of the records fe airport board thanks.

    while($row = sqlsrv_fetch_array($stmt)){
    echo "<tr class='alt'><td>";    
    echo "<img src = '".$row['Image']."' height='100' width='100'/>";
    echo "</td><td>";
    echo $row['Student_Name'];
    echo "</td><td>";
    echo $row['Req_Time']->format('D M d  H:i:s ');
    echo "</td></tr>";
    }
    echo "</table></center>";

You can use JQuery Ajax to submit a post request that will return the table you want. Using setTimeout o setInterval you can control when to refresh the table. And you can send the variables limit and offset to use in your query to show only the info you want.

Check the library http://api.jquery.com/jquery.ajax/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM