$newq=mysql_query("SELECT * from userrights WHERE UserId=$Id");
$array=array();
$r1=mysql_fetch_array($newq);
$menuid=$r1['MenuId'];
<select name="page[]" multiple="multiple" size="5" >
<option disabled="disabled" value="">Choose one</option>
<?php
$query1=mysql_query("SELECT * FROM adminmenu");
while($row1=mysql_fetch_array($query1)){
$selected = ($menuid == $row1['MenuId'] ? 'selected="selected"' : '');
echo"<option value='$row1[MenuId]' $selected >".$row1['MenuName']."</option>";
}
?>
</select>
rjusman90 0 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.