Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
- <html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"pl-PL\">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8">
- <title>Rezultat zapytania</title>
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"
- integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
- </head>
- <body>
- <?php
- ini_set("display_errors", 0);
- require_once 'dbconnect.php';
- $polaczenie = mysqli_connect($host, $user, $password);
- mysqli_query($polaczenie, "SET CHARSET utf8");
- mysqli_query($polaczenie, "SET NAMES 'utf8' COLLATE 'utf8_polish_ci'");
- mysqli_select_db($polaczenie, $database);
- $zapytanietxt = file_get_contents("zapytanie.sql");
- $rezultat = mysqli_query($polaczenie, $zapytanietxt);
- $ile = mysqli_num_rows($rezultat);
- //var_dump($zapytanietxt);
- if ($ile >= 1) {
- echo <<<END
- <div class="container col-9">
- <div class="row">
- <table class="table table-striped table-dark">
- <thead>
- <tr>
- <th scope="col">#ID</th>
- <th scope="col">Słówko po polsku</th>
- <th scope="col">Słówko po angielsku</th>
- <th scope="col">Wymowa</th>
- <th scope="col">Kategoria</th>
- </tr>
- </thead>
- <tbody>
- END;
- }
- for ($i = 1; $i <= $ile; $i++) {
- $row = mysqli_fetch_assoc($rezultat);
- $id = $row['id'];
- $slowko = $row['slowko'];
- $word = $row['word'];
- $wymowa = $row['wymowa'];
- $category_name = $row['category_name'];
- //$category_id = $row['category_id'];
- echo <<<END
- <tr>
- <td scope="row">$id</td>
- <td class="col-3">$slowko</td>
- <td class="col-3">$word</td>
- <td class="col-2">$wymowa</td>
- <td class="col-3">$category_name</td>
- </tr>
- END;
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"
- integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
- crossorigin="anonymous"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js"
- integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
- crossorigin="anonymous"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"
- integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
- crossorigin="anonymous"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement