How to show selected items in multiple select Box
===

This is my mutiple select drop down box in edit page. Problem here is that this shows only one selected items. It doesn't show all selected items in it. How can i correct this? 

 

        <?php
    		 $query="SELECT * FROM lab";
    		$dropdown = "<select name='labid[]' multiple='multiple'  style='height:80px;' size='5' id='lab'>";
    		//$dropdown .= "<option value=''>Select lab to assign </option>";
    		$result2 = mysql_query ($query);
            while($row2 = mysql_fetch_assoc($result2)) 
    		{
    		
      $dropdown .= "\r\n<option value='{$row2['lab_id']}'";
                while($row1 = mysql_fetch_assoc($result1)) 
    		      {
    				 if(($row1['lab_id'])==($row2['lab_id']))
    				  {
    					  $dropdown .=" selected='selected'";
    				  }
    			 }
      $dropdown .= ">{$row2['l_name']}</option>";
    		}
    		$dropdown .= "\r\n</select>";
    		echo $dropdown;
           ?>