I need one help .I can not display some db values inside select tag using PHP and MySQL.I am explaining my code below.
<?php
while($row=mysql_fetch_array($sql)){
if($row['status']==1){
$status=1;
}else{
$status=0;
}
$id=$row['id'];
echo "<tr>
<td>".$counter++."</td>
<td>".$row['pincode']."</td>
<td>".$row['area']."</td>
<td>
<select class='form-control' id='status' name='status' onchange='javascript:adminstatus()' style='height:23px; padding:0px;'>
<option value=''>Select Status</option>
<option value='1' ".$row['status']."=='1'?'selected':'';>Enable</option>
<option value='0' ".$row['status']."=='0'?'selected':'';>Disable</option>
</select>
</td>
?>
Here I need when $status==1 the enable will select and $status==0 disable will select.Please help me.