Advertisement
Guest User

Untitled

a guest
Oct 4th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. <?php
  2. $table="ksiegarnia";
  3. $Gatunek=$_GET['Gatunek'];
  4. $user="root";
  5. $pass="";
  6. $database="ksiegarnia";
  7. $adres="localhost";
  8.  
  9. $conn = mysqli_connect($adres,$user,$pass,$database);//or die("You can't connect to the server");
  10. //@mysql_select_db() or die("Not found database");
  11. $query = "SELECT * FROM $table where Gatunek='$Gatunek'";
  12. echo "<Table border=\"1\"><tr><th>id_k</th><th>Tytul</th><th>Rok_wydania</th><th>Cena</th><th>Gatunek</th><th>Autor</th></tr>";
  13. if ($result = mysqli_query($conn, $query)) {
  14. while ($row = mysqli_fetch_assoc($result)) {
  15. $id_k=$row["id_k"];
  16. $Tytul=$row["Tytul"];
  17. $Rok_wydania=$row["Rok_wydania"];
  18. $Cena=$row["Cena"];
  19. $Gatunek=$row["Gatunek"];
  20. $Autor=$row["Autor"];
  21. echo "<tr><td>";
  22. echo $id_k,"</td><td>",$Tytul,"</td><td>",$Rok_wydania,"</td><td>",$Cena,"</td><td>",$Gatunek,"</td><td>",$Autor,"</td></tr>";
  23. }
  24. mysqli_free_result($result);
  25. echo "</Table>";
  26. }
  27. mysqli_close($conn);
  28. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement