Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $DatabaseServer = "localhost";
- $DatabaseUsername = "root";
- $DatabasePassword = "root";
- $DatabaseName = "demo";
- $Connection = mysqli_connect($DatabaseServer, $DatabaseUsername, $DatabasePassword, $DatabaseName);
- if ($Connection === false) {
- die("ERROR: Could not connect. " . mysqli_connect_error());
- }
- $sqlusers = "select * from user";
- $result = mysqli_query($Connection, $sqlusers);
- echo "<form method='POST'>";
- while($rowuser = mysqli_fetch_array($result)){
- $user = $rowuser['FirstName'];
- echo "<input type='text' name='firstName' value='$user' readonly>";
- echo "<select name='attendanceType'>";
- $sqltype = "select * from attendancetype";
- $resultaType = mysqli_query($Connection, $sqltype);
- while($rowtype = mysqli_fetch_array($resultaType)){
- echo "<option>";
- echo $rowtype['name'];
- echo "</option>";
- }
- echo "</select>";
- echo "<br>";
- }
- echo "<input type='submit' name='submit' value='submit'>";
- echo "</form>";
- ?>
Add Comment
Please, Sign In to add comment