Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <?php
- $host = "localhost";
- $username = "redacted";
- $password = "redacted";
- $db = "redacted";
- $connection = mysqli_connect($host, $username, $password, $db);
- if (mysqli_connect_errno()) {
- echo "Connection error";
- }
- $query = "SELECT * FROM main";
- $result = $connection->query($query);
- ?>
- <html>
- <head>
- <title>Test Page</title>
- </head>
- <body>
- <h1>Test Main Table Display</h1>
- <table>
- <?php
- // first instance
- while($row = mysqli_fetch_array($result)) {
- echo "<tr>";
- echo "<td>" . $row['user'] . "</td>";
- echo "<td>" . $row['date'] . "</td>";
- echo "<td>" . $row['count'] . "</td>";
- echo "<td>" . $row['action'] . "</td>";
- echo "<td><button>Expand</button></td>";
- echo "</tr>";
- }
- ?>
- </table>
- <h1>Test User Entry Appendment</h1>
- <form>
- <label>Select a user, or add a new user.</label><br>
- <select>
- <?php
- // second instance
- while($row = mysqli_fetch_array($result)) {
- echo "<option>" . $row['user'] . "</option>";
- }
- ?>
- </select>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement