PHP+MYSQL数据库查询显示
来源:互联网 发布:xbox one 移动网络 dns 编辑:程序博客网 时间:2024/05/22 03:25
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>会员列表</title></head><?php $link = mysql_connect("localhost","root","");//连接MySQL服务器 $db = mysql_select_db("club");//选择数据库 mysql_query("set names utf8",$link);//设定编码方式 $sql = "Select * from member"; $result = mysql_query($sql,$link);//执行SELECT查询 $num = mysql_num_rows($result);//获取记录条数?><body><h1>健身俱乐部 会员名册</h1><br />点击姓名可查看该会员详细资料,现有会员<? echo $num?>人。<br /><?php if($num > 0) {?><table border="1" cellpadding="1" cellspacing="1"><tr><td>序号</td><td>姓名</td><td>性别</td></tr><?php while($row = mysql_fetch_array($result)) { echo "<tr><td>" . $row['id'] . "</td><td><a href=member.php?name=" . $row['name'] . ">" . $row['name']. "</a></td><td>" . ($row['sex']==1?"女":"男") . "</td></tr>"; }?></table><?php } else { echo "俱乐部尚未发展会员。"; }?></body></html>
0 0
- PHP+MYSQL数据库查询显示
- php连接、查询mysql数据库
- PHP查询数据库显示数据的方法
- PHP和MYSQL查询和分页显示
- php+mysql,php连接mysql,查询与分页显示
- Mysql数据库查询按时间递减显示
- thinkphp连接mysql数据库查询数据显示
- mysql php 数据库查询附近的好友
- PHP取mysql数据库显示乱码--解
- PHP随机显示mysql数据库中的数据
- php使用mysql扩展库链接mysql数据库(查询)
- 关于网页中显示php查询数据库结果乱码问题
- php数据库查询分页显示操作(一)
- PHP显示MySQL查询结果时中文问号
- PHP连接MySQL查询结果中文显示乱码问题
- PHP程序+mysql查询显示数据转码
- PHP连接MySQL查询结果中文显示乱码解决方法
- Mysql数据库查询到的数据设置伪列显示
- 第八周--字符串加密
- python str.join 和 os.path.join
- C语言(3) 运算符及优先级
- java复制大文件
- 如何判断一个数是不是2的n次幂
- PHP+MYSQL数据库查询显示
- c++类静态成员详解
- PL语句块中各种循环
- 5.Xamarin.Forms里按钮的实现
- 网站国际化代码-多语言
- 解决虚拟机提示VMwareWorkstationcannotconnecttothevirtualmachine的问题
- Service的使用
- MongoDB基本使用
- sitemesh教程-页面装饰技术原理及应用