am new in php..i am trying to filter my datas from db by using dropdownlist..my code in view form is like

```
   <?php 
    if(isset($value))
    {
       if($value==1)
      {
      echo"<option value='1' selected>option1</option>
           <option value='0' >option2</option>";    
      } 

      if($value==0)
      {
      echo"<option value='1' >option1</option>
           <option value='0' selected >option2</option>";   
      }    
    }           
    else    
    {
      echo"<option value='1'>option1</option>
           <option value='0'>option2</option>"; 
           $value="";
    }              

  ?>

```

but if am selecting option1 its working correctly..but when am clicking option2 its filtering the correct datas but its selecting the status only..selected value is status ,ie same as null value...