Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <!-- Required meta tags -->
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
- <!-- Bootstrap CSS -->
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- <title>Speiseplan</title>
- </head>
- <body>
- <div class="container">
- <h1>Speiseplan pro Tag</h1>
- <?php
- $servername = "127.0.0.1";
- $username = "ROOT";
- $password = "AQ";
- $database = "Speiseplan";
- try {
- $conn = new PDO("mysql:host=$servername;dbname=$database", $username, $password);
- $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
- $sql = "SELECT * FROM $database";
- foreach ($conn->query($sql) as $row) {
- echo $row['Tag']."<br />";
- echo $row['Menü1']."<br />";
- echo $row['Menü2']."<br />";
- echo $row['Vegetarisch']."<br />";
- echo $row['Dessert']."<br /><br />";
- $stmt->execute();
- }
- }
- catch(PDOException $e) {
- echo "Error: " . $e->getMessage();
- }
- ?>
- </div>
- </body>
- </html>
- <table class="table table-hover table-dark">
- <thead>
- <tr>
- <th scope="col"></th>
- <th scope="col">Tag</th>
- <th scope="col">Menü1</th>
- <th scope="col">Menü2</th>
- <th scope="col">Vegetarisch</th>
- <th scope="col">Dessert</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <th scope="row">1</th>
- <td></td>
- <td>Otto</td>
- <td>@mdo</td>
- </tr>
- <tr>
- <th scope="row">2</th>
- <td>Jacob</td>
- <td>Thornton</td>
- <td>@fat</td>
- </tr>
- <tr>
- <th scope="row">3</th>
- <td colspan="2">Larry the Bird</td>
- <td>@twitter</td>
- </tr>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement