this is my page to show records of speed items(value, #date). $records array contains latest records reside in database.
i ve been asked to add a refresh button so when user click on it , well, it simply refresh table.
can $records array be refreshed some how?
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="../assets/bootstrap/css/bootstrap.css">
<script src="../assets/bootstrap/js/bootstrap.js"></script>
<title>Document</title>
</head>
<body class="container-fluid">
<?php
require $_SERVER["DOCUMENT_ROOT"]."...";
$ctrl = new SpeedController();
$records = $ctrl::readAll();
?>
<table class= "table table-bordered table-striped">
<thead>
<tr>
<th scope="col">value</th>
<th scope="col">date</th>
</tr>
</thead>
<tbody>
<?php foreach ($records as $value => $time): ?>
<tr>
<td><?php echo htmlspecialchars($value); ?></td>
<td><?php echo htmlspecialchars($time); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</body>
</html>
New contributor
Amin Firouzi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1