请教生日,性别,地址如何存储和读取(选择模式!)

WBOY
Release: 2016-06-23 13:41:08
Original
973 people have browsed it

比如生日是1990-01-11 怎么在读取的时候自动还原成
性别是:0(保密),保密,男,
地址是:gd755(广东省深圳市)还原为


回复讨论(解决方案)

1、从数据库取记录
2、将记录结果集赋值给数组
3、写好所有表单项
4、将数组中的值 赋值给表单

楼上正解,这些是基础问题

例子:

<?php$conn=mysql_connect('localhost','root','flash') or die('连接服务器失败');$select=mysql_select_db('test',$conn) or die("连接数据库失败");$query = "select * from stu";echo '<select name="sign"> '; if ($result=@mysql_query($query)){ $i=0; while($rows=@mysql_fetch_array($result)) { echo "<option value='$rows[id]'>$rows[name]</option>"; $i++; } mysql_free_result($result); echo '</select>'; } else echo "执行SQL语句($query)失败:".mysql_error(); ?>
Copy after login

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