//USE OF SELECT OPTION WHICH SHOW VALUE ACCORDING DATABASE
<?php
include('my_conn.php');
$my_sql="SELECT *
FROM login
WHERE lid =1101";
$myresult=mysql_query($my_sql);
while($row_select=mysql_fetch_array($myresult))
{
$check=$row_select['lactive'];
}
//$check="";
?>
<form action="" post="">
<select id="lactive" name="lactive">
<?php
if($check=="")
{
echo '<option value="">Select..</option>';
echo '<option value="YES">YES</option>';
echo '<option value="NO">NO</option>';
}
else
{
if($check=='YES')
{
echo '<option value="<?=$check;?>">Yes</option>';
echo '<option value="No">No</option>';
}
else
{
echo '<option value="<?=$check;?>">No</option>';
echo '<option value="">Yes</option>';
}
}
?>
</select>
<input type="submit" id="submit" name="submit"/>
</form>
Nice Example and it is very helpful for me. Thanks and Regards
ReplyDeleteBest Wish https://www.geneva-airporttransfer.com/