Well I have a select statement like this:
I think i need to do it like the following in order to make it work:PHP Code:mysql_connect($db_host, $db_user, $db_pwd);
mysql_select_db($db_name);
$department "SELECT department FROM authorize";
$sql = "select * from authorize";
$result = mysql_query($sql);
?>
<form action="super.php" method="post">
<select name="username">
<?php
while($row=mysql_fetch_assoc($result))
{
$username = $row['username'];
$name = $row['firstname']." ".$row['lastname'];
echo "<option value=\"$username\">$name</option>";
}
?>
</select>
<input type="submit" value="Submit" name="submit" />
</form>
Select department, department2, department3, department4, department5, department6 from table where username ="$_SESSION[username];
Select department from all users. If department is equal to department, department2, department3, department4, department5, department6 then show all users in select option list.




Bookmarks