Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <!DOCTYPE HTML>
  2. <html lang="pl">
  3. <head>
  4. <meta charset="utf-8">
  5. </head>
  6. <body>
  7. <?php
  8. $server = 'localhost';
  9. $user = 'root';
  10. $pass = '';
  11. $db ='firma';
  12. $conn=new mysqli($server, $user, $pass, $db);
  13.  
  14. if($wynik = $conn->query("SELECT * FROM pracownicy")){
  15.  
  16. if($wynik->num_rows > 0){
  17. echo "<table border='1' cellpadding='10'>";
  18.  
  19. echo "<tr><th>ID</th><th>Imie</th><th>Nazwisko</th><th>Placa</th><th>Stanowisko_id</th><th>Pesel</th></tr>";
  20.  
  21. while($record = $wynik->fetch_object()){
  22. echo "<tr>";
  23. echo "<td>" . $record->id. "</td>";
  24. echo "<td>" . $record->imie. "</td>";
  25. echo "<td>" . $record->nazwisko. "</td>";
  26. echo "<td>" . $record->placa. "</td>";
  27. echo "<td>" . $record->stanowisko_id. "</td>";
  28. echo "<td>" . $record->pesel. "</td>";
  29. echo "</tr>";
  30. }
  31. echo "</table>";
  32. } else {
  33. echo "Brak rekordów";
  34. }
  35. }
  36. ?>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement