// display form
print "<select name=\"uid\">";
$query = "SELECT uid, uname FROM xoops_users ORDER by uname";
$result = mysql_query($query);
while(list($uid) = mysql_fetch_array($result)) {
print "<option value=\"$uname\">$uid</option>";
}
?>
k, I would like to have the value of uid inserted into a new table but have the script print the uname instead of uid so I know who is who.
So then the scipt would consist of this
//query and insert
if ($submit) {
// process form
$sql = "INSERT INTO users(user_id) VALUES ('$user_id')";
$result = mysql_query($sql);
echo "thank you";
} else{
// display form
print "<select name=\"uid\">";
$query = "SELECT uid, uname FROM users ORDER by uname";
$result = mysql_query($query);
while(list($uid) = mysql_fetch_array($result)) {
print "<option value=\"$uname\">$uid</option>";
}
?>