Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <link href="css/bootstrap.min.css" rel="stylesheet">
- <link href="css/main.css" rel="stylesheet">
- <script src="js/bootstrap.min.js"></script>
- </head>
- <body>
- <div class="container">
- <div class="row">
- <h3>DVD</h3>
- </div>
- <div class="row">
- <p>
- <a href="create.php" class="btn btn-success">Create</a>
- </p>
- <table class="table table-striped table-bordered">
- <thead>
- <tr>
- <th>Title</th>
- <th>Description</th>
- <th>Origin Country</th>
- <th>Duration</th>
- <th>Releasedate</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <?php
- include 'database.php';
- $pdo = Database::connect();
- $sql = 'SELECT * FROM tl_dvd';
- foreach ($pdo->query($sql) as $row) {
- echo '<tr>';
- echo '<td>'. $row['title'] . '</td>';
- echo '<td>'. $row['description'] . '</td>';
- echo '<td>'. $row['origin_country'] . '</td>';
- echo '<td>'. $row['duration'] . '</td>';
- echo '<td>'. $row['release_date'].'</td>';
- echo '<td width=250>';
- echo '<a class="btn" href="read.php?id='.$row['id'].'">Read</a>';
- echo ' ';
- echo '<a class="btn btn-success" href="update.php?id='.$row['id'].'">Update</a>';
- echo ' ';
- echo '<a class="btn btn-danger" href="delete.php?id='.$row['id'].'">Delete</a>';
- echo '</td>';
- echo '</tr>';
- }
- Database::disconnect();
- ?>
- </tbody>
- </table>
- </div>
- </div> <!-- /container -->
- </body>
- </html>
- <?php
- require 'database.php';
- $pdo = Database::connect();
- $sql = 'SELECT * FROM tl_ dvd WHERE id = ?';
- foreach ($pdo->query($sql) as $row) {
- echo '<tr>';
- echo '<td>'. $row['title'] . '</td>';
- echo '<td>'. $row['description'] . '</td>';
- echo '<td>'. $row['origin_country'] . '</td>';
- echo '<td>'. $row['duration'] . '</td>';
- echo '<td>'. $row['releasedate'] . '</td>';
- echo '</tr>';
- }
- Database::disconnect();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement