Home >Backend Development >PHP Tutorial >ThinkPHP数据库查询结果在表单展示

ThinkPHP数据库查询结果在表单展示

WBOY
WBOYOriginal
2016-06-13 10:56:521039browse

ThinkPHP数据库查询结果在表单显示
数据库中表为个人信息表,有性别字段,用ThinkPHP从数据库中取出数据之后,如何根据结果,改变表单中




那个单选框被选中呢?

------解决方案--------------------
假设你取出来的值为 $sex,
/>男
/>女
------解决方案--------------------

HTML code
<input type="radio" name="sex" value="男" checked>男<br><font color="#e78608">------解决方案--------------------</font><br><if condition="$vo['sex'] eq '男'"><br>男<br><else></else><br>女<br></if><div class="clear">
                 
              
              
        
            </div>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn