Guest User

Untitled

a guest
Feb 16th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <?php
  2.  
  3. $DatabaseServer = "localhost";
  4. $DatabaseUsername = "root";
  5. $DatabasePassword = "root";
  6. $DatabaseName = "demo";
  7.  
  8. $Connection = mysqli_connect($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName);
  9.  
  10. if ($Connection === false) {
  11. die("ERROR: Could not connect. " . mysqli_connect_error());
  12. }
  13.  
  14. $sqlusers = "select * from user";
  15. $result = mysqli_query($Connection, $sqlusers);
  16. echo "<form method='POST'>";
  17. while($rowuser = mysqli_fetch_array($result)){
  18. $user = $rowuser['FirstName'];
  19.  
  20.  
  21. echo "<input type='text' name='firstName' value='$user' readonly>";
  22. echo "<select name='attendanceType'>";
  23.  
  24. $sqltype = "select * from attendancetype";
  25. $resultaType = mysqli_query($Connection, $sqltype);
  26. while($rowtype = mysqli_fetch_array($resultaType)){
  27. echo "<option>";
  28. echo $rowtype['name'];
  29. echo "</option>";
  30. }
  31.  
  32. echo "</select>";
  33. echo "<br>";
  34.  
  35. }
  36. echo "<input type='submit' name='submit' value='submit'>";
  37. echo "</form>";
  38. ?>
Add Comment
Please, Sign In to add comment