数据|数据库|源代码
//mysql数据库的sql
CREATE TABLE user( id int(5) DEFAULT '0' NOT NULL AUTO_INCREMENT, name varchar(20), city varchar(20), postcode varchar(10),address varchar(100), password varchar(10), level tinyint(2) DEFAULT '0',right tinyint(2),email varchar(40), PRIMARY KEY (id), UNIQUE id (id));
INSERT INTO myuser VALUES (1,'王友','北京','100083','北京市海淀区学院路',111,0,0,'wangyou000@263.net');
INSERT INTO myuser VALUES (2,'金风','武汉','430071','武汉市武昌区水果湖',111,0,0,'jinfeng000@263.net');
INSERT INTO myuser VALUES (3,'常丽','襄樊','441021','襄樊市襄城区南街',111,0,0,'changli000@263.net');
1.查寻全部
id | 姓名 | ";城市 | 邮编 | ";住 址 | 等级 | ";权限 | 邮件地址 | ";
%s | %s | ", $myrow[0], $myrow[1]);%s | %s | ", $myrow[2], $myrow[3]);%s | %s | ", $myrow[4], $myrow[6]);%s | %s |
2.根据id查询
3.更新
4.增加删除记录
";
}
else
if ($delete)
{
// 删除一条记录
$sql = "DELETE FROM myuser WHERE id=$id";
$result = MySQL_query($sql);
echo "记录删除成功!
";
}
else
{
printf("