Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require_once "connect.php";
- $user = $_SESSION['user'];
- $polaczenie = @new mysqli($host, $db_user, $db_password, $db_name);
- if ($polaczenie->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- }
- $sql = ' SELECT * from linki';
- $result = $polaczenie->query($sql);
- if ($result->num_rows > 0) {
- echo '<div id="tablecontainer"><table class="table table-striped"tr><th>Link</th><th>Autor</th><th>Opis</th>';
- while($row = $result->fetch_assoc()) {
- echo "<tr><td>".'<a href="'.$row["link"].'">Klik! </a>'."</td><td>".$row["autor"]."</td><td>".$row["opis"]."</td></tr>";}}
- else {
- echo '<div id="tablecontainer"><table class="table table-striped"tr><th>Link</th><th>Autor</th><th>Opis</th>';}
- echo '</table></div>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement