Advertisement
Guest User

Untitled

a guest
Feb 28th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5.  
  6. <title>My page title</title>
  7. <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Sonsie+One" rel="stylesheet" type="text/css">
  8. <link rel="stylesheet" href="style.css">
  9.  
  10.  
  11. </head>
  12.  
  13. <body>
  14.  
  15.  
  16. <header>
  17. <h1>logo strony</h1>
  18. </header>
  19.  
  20. <nav>
  21. <table >
  22. <td style="background-color:#ffff99"><a href="#">strona głowna</a></td>
  23. <td style="background-color:#ffcc99"><a href="#">cw MYSQL</a></td>
  24. <td style="background-color:#ff9999"><a href="#">cw postgreSQL</a></td>
  25. </table>
  26.  
  27.  
  28.  
  29. </nav>
  30.  
  31.  
  32. <main>
  33. <table >
  34.  
  35. <td id='tdl' bgcolor="#99ffff">
  36. <article style="background-color:#99ffff">
  37. <?php
  38. $servername = "localhost";
  39. $username = "root";
  40. $password = "";
  41. $dbname='waluk';
  42. $conn = new mysqli($servername, $username, $password);
  43. if ($conn->connect_error) {
  44. die("niedziala " . $conn->connect_error);
  45. }
  46. else
  47. {
  48. $conn = new mysqli($servername, $username, $password, $dbname);
  49.  
  50. $sql="SELECT * FROM turystyka ";
  51. $result = $conn->query($sql);
  52. if ($result->num_rows > 0) {
  53. while($row = $result->fetch_assoc()) {
  54. echo "id: " . $row["id"]. " - nazwa : " . $row["kraj"]. " " . $row["dowolna_tresc"]. "<br>";
  55. echo '<img src="data:image/jpeg;base64,"'.base64_encode($row['zdjecie']).'"/>';
  56. }
  57. } else {
  58. echo "0 results";
  59. }
  60. $conn->close();
  61.  
  62. }/*
  63. $myPDO = new PDO('pgsql:host=localhost;dbname=waluk', 'postgres', 'postgres');
  64. $result = $myPDO->query("SELECT * FROM turystyka");
  65. if ($result->pg_num_rows > 0) {
  66. while($row = $result->pg_fetch_assoc()) {
  67. echo "id: " . $row["id"]. " - nazwa : " . $row["kraj"]. " " . $row["dowolna_tresc"]. "<br>";
  68. }
  69. } else {
  70. echo "0 results";
  71. }*/
  72. ?>
  73.  
  74. </article>
  75. </td>
  76.  
  77. <td bgcolor="#9999ff">
  78. <aside>
  79. <ul>
  80. <li><a href="#">strona głowna</a></li>
  81. <li><a href="#">cw MYSQL</a></li>
  82. <li><a href="#">cw postgreSQL</a></li>
  83. </ul>
  84. </aside>
  85. </td>
  86. </table>
  87. </main>
  88. <footer style="background-color:gray">
  89. <p>gabriel waluk</p>
  90. </footer>
  91.  
  92. </body>
  93. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement