Advertisement
Guest User

Untitled

a guest
Feb 2nd, 2017
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. <!-- Mitgliederliste -->
  2.  
  3. <html lang="de">
  4.  
  5. <head>
  6. <title>Mitglider</title>
  7. <link rel="stylesheet" type="text/css" href="style.css">
  8. </head>
  9.  
  10. <body>
  11.  
  12. <table>
  13.  
  14. <tr><td>Vorname</td><td>Nachname</td><td>Rang</td><td>Geburtsdatum</td></tr>
  15.  
  16. <?php
  17.  
  18. $DBUser="root";
  19. $DBHost="localhost";
  20. $DBPass="asr";
  21. $DBName="Feuerwehr";
  22.  
  23. $connect=mysqli_connect($DBHost,$DBUser,$DBPass,$DBName)
  24. or die("Verbindung zur Datenbank fehlgeschlagen");
  25.  
  26. $sql_command="SELECT Vorname,Nachname,ID,Rang,Funktion,Geburtsdatum,Personalnummer FROM `Mitglieder`";
  27. $DBQuery=mysqli_query($connect,$sql_command);
  28.  
  29. while($DBZeile=mysqli_fetch_array($DBQuery))
  30. {
  31. if(isset($DBZeile ["Vorname"]))
  32. {
  33. echo "<tr><td>". $DBZeile ["Vorname"]. "</td>";
  34. }
  35. if(isset($DBZeile ["Nachname"]))
  36. {
  37. echo "<td>" . $DBZeile ["Nachname"]. "</td>";
  38. }
  39. if(isset($DBZeile ["Rang"]))
  40. {
  41. echo "<td>" . $DBZeile ["Rang"]. "</td>";
  42. }
  43. else
  44. {
  45. echo "<td>" . " ---- " . "</td>";
  46. }
  47. // if(isset($DBZeile ["Funktion"]))
  48. // {
  49. // echo "<td>" . $DBZeile ["Funktion"]. "</td>";
  50. // }
  51. // else
  52. // {
  53. // echo "<td>" . " ---- " . "</td>";
  54. // }
  55. if(isset($DBZeile ["Geburtsdatum"]))
  56. {
  57. echo "<td>" . $DBZeile ["Geburtsdatum"]. "</td></tr>";
  58. }
  59. }
  60. $close=mysqli_close($connect);
  61.  
  62. ?>
  63.  
  64. </table>
  65.  
  66. </body>
  67. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement