根据php中的数据库值更改单选按钮的值

时间:2018-11-29 05:41:48

标签: php html if-statement

我的表单中有一个单选按钮

<intent-filter android:label="MySite.Uz">
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data android:scheme="https"
                android:host="mysite.uz"
               android:pathPattern="/[0-9]*"/>

</intent-filter>

如何根据数据库值设置单选按钮值,例如

select top 3 * from Worker order by salary asc

1 个答案:

答案 0 :(得分:2)

单选按钮值取决于选中的属性

如果使用条件设置选中的属性,则将设置其值

示例:

<input type="radio" id="radio-2" name="radio" value="50" <?php echo ($db_val==2)?'checked':'' ?> onclick="calculate()" >
<input type="radio" id="radio-2" name="radio" value="100" <?php echo ($db_val!=2)?'checked':'' ?>  onclick="calculate()" >