I ddnt get ur idea properly. Any how i will post part of my edit user form. then it will be clear what iam asking for
include("config.php");
$id = $_GET['id'];
$result = mysql_query("SELECT * FROM members WHERE id=$id")
or die(mysql_error());
$row = mysql_fetch_array($result);
if($row)
{
$login = $row['login'];
$email = $row['email'];
$type = $row['type'];
}
}
?>
<div align="center"><center>
<table width="436" id="table">
<tr>
<td width="214">Username</td>
<td width="254"><input name="login" maxlength="10" id="login" value="<?php echo $login;?>"/></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" id="password" name="password" maxlength="10" value="*******"/></td>
</tr>
<tr>
<td>email</td>
<td><input type="text" id="email" name="email" maxlength="50" value="<?php echo $email;?>"/></td>
</tr>
<tr>
<td>Select user type </td>
<td><select name="type" id="type" >
<option value="admin"> Admin </option>
<option value="labassistant"> Lab Assistant </option>
<option value="storekeeper"> Store Keeper </option>
</select></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="button" id="button" value="Edit user"/></td>
</tr>
</table>
Actually i want to display existing results for user type. How can i do it. How can i choose selected option according to database results?