Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Media List</title>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
- </head>
- <body>
- <div class="container">
- <h1>Media List</h1>
- <a href="form_cadastro.html">Cadastrar</a>
- <br><br>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>ID</th>
- <th>Data</th>
- </tr>
- </thead>
- <tbody>
- <?php
- // Connect to the database
- $conn = mysqli_connect("servidor", "usuario", "senha", "base de dados");
- // Retrieve data from the database
- $query = mysqli_query($conn, "SELECT * FROM media ORDER BY id DESC");
- while($row = mysqli_fetch_array($query)){
- echo "<tr>";
- echo "<td>". $row['id']. "</td>";
- echo "<td>". $row['data']. "</td>";
- echo "</tr>";
- }
- // Close the connection
- mysqli_close($conn);
- ?>
- </tbody>
- </table>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement