Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <body>
- <form action="sign.php" method="post">
- <input name="username" type="text" placeholder="Username">
- <input name="password" type="password" placeholder="Password">
- <button name="submit" type="submit">SIGN UP</button>
- </form>
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $databasename = "loginfromscratch";
- $connection = new mysqli($servername, $username, $password, $databasename);
- //Get number of rows
- $sql="SELECT * FROM users";
- $result=mysqli_query($connection, $sql);
- $i=1;
- while($row=mysqli_fetch_assoc($result))
- {
- $date[$i] = $row['user_username'];
- $period[$i] = $row['user_password'];
- $i++;
- }
- //Start table
- echo "<table>";
- echo "<tr><th>Date</th><th>Period</th><th>Room</th><th>Teacher Initials</th></tr>";
- // Loop through the results from the database
- for ($i = 1; $i <=count($date); $i++)
- {
- // Show entries
- echo
- "<tr>
- <td>$date[$i]</td>
- <td>$period[$i]</td>
- </tr>";
- }
- echo "</table>"
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement