Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. $serverName="localhost";
  3. $userName="root";
  4. $password="";
  5. $dbName="poradnia";
  6. $conn=mysqli_connect($serverName,$userName,$password,$dbName);
  7. if (!$conn){
  8. die("blad polaczenia".mysqli_connect_error());
  9.  
  10. }
  11. $sql="select id,imie,nazwisko,choroba from pacjenci;";
  12.  
  13.  
  14. $wynik=mysqli_query($conn,$sql);
  15. if(!$wynik){
  16. die("vlad zapisywania".mysqli_error($conn));
  17.  
  18. }
  19. if (mysqli_num_rows($wynik)>0){
  20. while ($row=mysqli_fetch_assoc($wynik)){
  21. echo $row["id"]." ".$row["imie"]." ".$row["nazwisko"]." ".$row["choroba"]."<br>";
  22. }
  23.  
  24.  
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement