Advertisement
noam76

display_data.php

May 13th, 2023
812
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. <?php
  2. require_once 'config.php';
  3.  
  4. $interval = $_POST['interval']; // Get the user-defined interval from a form
  5.  
  6. // Fetch data from the "data_storage" table
  7. $stmt = $conn->prepare("SELECT * FROM data_storage");
  8. $stmt->execute();
  9. $data = $stmt->fetchAll(PDO::FETCH_ASSOC);
  10.  
  11. // Display the data in a table
  12. echo "<table>";
  13. foreach ($data as $row) {
  14.     echo "<tr>";
  15.     echo "<td>" . implode("</td><td>", json_decode($row['register_data'], true)) . "</td>";
  16.     echo "</tr>";
  17. }
  18. echo "</table>";
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement