Advertisement
Guest User

PHP-wyswietanie

a guest
Apr 4th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <?php
  2. $serwer = "localhost";
  3. $user = "root";
  4. $pass = "";
  5. $dbname = "rowerowy";
  6.  
  7. $polaczenie = new mysqli($serwer, $user, $pass, $dbname);
  8. if ($polaczenie->connect_error) {
  9. die("Connection failed: " . $polaczenie->connect_error);
  10. }
  11.  
  12. $wynik = mysqli_query($polaczenie,"SELECT * FROM rowery");
  13.  
  14. if(mysqli_num_rows($wynik) > 0) {
  15.  
  16. echo "<table border=1>";
  17. echo "<tr> <td>ID</td> <td>Producent</td> <td>Model</td> <td>Rozmiar Ramy</td> <td>Rozmiar Kola</td> </tr>";
  18. while($r = mysqli_fetch_assoc($wynik)) {
  19. echo "<tr>";
  20. echo "<td>".$r['Id']."</td>";
  21. echo "<td>".$r['Producent']."</td>";
  22. echo "<td>".$r['Model']."</td>";
  23. echo "<td>".$r['roz_Ramy']." cali</td>";
  24. echo "<td>".$r['roz_Kola']." cali</td>";
  25. echo "</tr>";
  26. }
  27. echo "</table>";
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement