i have this code here that i want to edit a row that is selected from the database, displayed in a <select> box, then the user on the page selects the name they want to make an admin, and it should edit the line to make user_admin = 1, not 0.
here is my code:
<?PHP
mysql_select_db("general");
$result = mysql_query("SELECT user_admin FROM users WHERE user_name = '".$_SESSION['user_name']."' ");
$result = mysql_fetch_array($result);
$user_admin = $result['user_admin'];
if ($user_admin==0) {
echo "<div align=center><span class=text>You are not an administrator. If you think you are supposed to be, click Contact Webmaster.</span></td><td width=550> ";
} else {
$result2 = mysql_query("SELECT user_name FROM users WHERE user_admin = '0' ");
while ($a = mysql_fetch_object($result2)){
echo '<option name=$a-> user_name>'. $a-> user_name.'</option>';
}
}
?>
and here is the code i want to be displayed after the option once i figure out what goes in the missing space
if(HTTP_POST_VARS['submit']) {
$result = mysql_query("EDIT user_admin FROM users WHERE user_name = 'what variable goes here for the user name selected in the <select> box?'