Home > Backend Development > PHP Tutorial > 如何让修改性别的下拉框显示数据库中原有的性别

如何让修改性别的下拉框显示数据库中原有的性别

WBOY
Release: 2016-06-23 14:09:59
Original
1951 people have browsed it

<tr>       <td width="148" bgcolor="#FFFFFF"><div align="center" class="STYLE2">        <div align="right" class="STYLE4">性别:</div>      </div></td>      <td width="443" bgcolor="#FFFFFF" height="41"> <label>        <select name="sex">		  <option>  </option>          <option>  男  </option>          <option>  女  </option>        </select>      </label></td>    </tr>
Copy after login


回复讨论(解决方案)

性别sex的字段类型是tinyint吧?假如0=男 1=女

性别sex的字段类型是tinyint吧?假如0=男 1=女
如果是varchar类型的该怎么改呢?

你的option是如何输出的? 输出时判断一下不就可以了。


性别sex的字段类型是tinyint吧?假如0=男 1=女
如果是varchar类型的该怎么改呢?


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template