It sounds like you want to construct a combo box/select field/etc that the user can click to drop down a list of users to select from - is that right?
How about something like this between the <br> tags after "Access the time..."?
<?
echo "<select>\n";
$query = "SELECT username FROM users ORDER BY username ASC";
$res = @mysql_query($query);
while($row = mysql_fetch_array($res)) {
printf("<option value=\"$row[username]\">$row[username]</option>\n");
}
mysql-free_result($res);
echo "</select>";
?>
I've assumed that you're connecting to the database somewhere above the opening <html> tag. If that's not a safe assumption, you might want to include something like this above <html>:
<?
$sql = mysql_connect(localhost, <db_user>, <password>);
@mysql_select_db(usersdb, $sql);
?>
Hope that helps.
|