Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>My page title</title>
- <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Sonsie+One" rel="stylesheet" type="text/css">
- <link rel="stylesheet" href="style.css">
- </head>
- <body>
- <header>
- <h1>logo strony</h1>
- </header>
- <nav>
- <table >
- <td style="background-color:#ffff99"><a href="#">strona głowna</a></td>
- <td style="background-color:#ffcc99"><a href="#">cw MYSQL</a></td>
- <td style="background-color:#ff9999"><a href="#">cw postgreSQL</a></td>
- </table>
- </nav>
- <main>
- <table >
- <td id='tdl' bgcolor="#99ffff">
- <article style="background-color:#99ffff">
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $dbname='waluk';
- $conn = new mysqli($servername, $username, $password);
- if ($conn->connect_error) {
- die("niedziala " . $conn->connect_error);
- }
- else
- {
- $conn = new mysqli($servername, $username, $password, $dbname);
- $sql="SELECT * FROM turystyka ";
- $result = $conn->query($sql);
- if ($result->num_rows > 0) {
- while($row = $result->fetch_assoc()) {
- echo "id: " . $row["id"]. " - nazwa : " . $row["kraj"]. " " . $row["dowolna_tresc"]. "<br>";
- echo '<img src="data:image/jpeg;base64,"'.base64_encode($row['zdjecie']).'"/>';
- }
- } else {
- echo "0 results";
- }
- $conn->close();
- }/*
- $myPDO = new PDO('pgsql:host=localhost;dbname=waluk', 'postgres', 'postgres');
- $result = $myPDO->query("SELECT * FROM turystyka");
- if ($result->pg_num_rows > 0) {
- while($row = $result->pg_fetch_assoc()) {
- echo "id: " . $row["id"]. " - nazwa : " . $row["kraj"]. " " . $row["dowolna_tresc"]. "<br>";
- }
- } else {
- echo "0 results";
- }*/
- ?>
- </article>
- </td>
- <td bgcolor="#9999ff">
- <aside>
- <ul>
- <li><a href="#">strona głowna</a></li>
- <li><a href="#">cw MYSQL</a></li>
- <li><a href="#">cw postgreSQL</a></li>
- </ul>
- </aside>
- </td>
- </table>
- </main>
- <footer style="background-color:gray">
- <p>gabriel waluk</p>
- </footer>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement