Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. <select class="form-control">
  2. <?php
  3. include 'db.php';
  4.  
  5. // Create connection
  6. $conn = new mysqli($servername, $username, $password, $dbname);
  7. // Check connection
  8. if ($conn->connect_error) {
  9. die("Connection failed: " . $conn->connect_error);
  10. }
  11.  
  12. $sql = "SELECT * from stanowiska";
  13. $result = $conn->query($sql);
  14. $wypad_z_bazy = $row["nazwa"];
  15.  
  16. if ($result->num_rows > 0) {
  17. // output data of each row
  18. while($row = $result->fetch_assoc()) {
  19. echo '<option>'.$wypad_z_bazy.'</option>';
  20. }
  21. } else {
  22. echo "0 results";
  23. }
  24. $conn->close();
  25. ?>
  26. </select>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement