Guest User

Minecraft Infinity Evoled wird an Weihnachten gespielt okey

a guest
Dec 11th, 2017
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1.  
  2. <!DOCTYPE html>
  3. <html>
  4. <body>
  5.  
  6. <?php
  7. $servername = "localhost";
  8. $username = "root";
  9. $password = "";
  10. $dbname = "ci3o117";
  11.  
  12. // Verbindung herstellen
  13. $conn = new mysqli($servername, $username, $password, $dbname);
  14. // Verbindung überprüfen
  15. if ($conn->connect_error)
  16. {
  17. die("Connection failed: " . $conn->connect_error);
  18. }
  19. ?>
  20.  
  21.  
  22. <!-- Dropdown Box mit den Werten aus der Datenbank -->
  23. <form action="index.php" method="GET">
  24. <select name="person">
  25. <option value="0" selected>--Bitte Waehlen--</option>
  26. <?php
  27. $sql = 'SELECT * FROM person order by Vorname';
  28. $result = mysqli_query($conn, $sql);
  29.  
  30. while($row = mysqli_fetch_array($result,MYSQL_ASSOC))
  31. {
  32. if($row['Vorname'] != "" && $row['Nachname'] != "")
  33. {
  34. echo '<option value="'.$row['PersonID'].'">'.$row['Vorname']." ". $row['Nachname'].'</option>';
  35. }
  36. }
  37. mysqli_free_result( $result );
  38.  
  39. echo '</select>';
  40. echo '<input type="submit" value="OK">';
  41. echo '</form>';
  42.  
  43.  
  44.  
  45. $conn->close();
  46. ?>
  47.  
  48.  
  49. </body>
Add Comment
Please, Sign In to add comment