-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewUserPosts.html
29 lines (27 loc) · 1.01 KB
/
ViewUserPosts.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
<head>
<title>View User Posts</title>
</head>
<body>
<h1>Select User</h1>
<form action="ViewUserPosts.php" method="post">
<select name='user_id'>
<?php
$mysqli = new mysqli("mysql.eecs.ku.edu", "tstrickler", "vai4Chai", "tstrickler");
if ($mysqli->connect_errno) {
printf("Failed to connect: %s\n", $mysqli->connect_error);
exit();
}
$query = "SELECT user_id FROM Users ORDER BY user_id";
$result = $mysqli->query($query);
while ($row = $result->fetch_assoc()) {
echo "<option value=" . $row["user_id"] . ">" . $row["user_id"] . "</option>";
}
$result->free();
$mysqli->close();
?>
</select>
<input type="submit" value="Submit"/>
</form>
</body>
<html>