php查询整张表的数据,php表格显示数据库信息-成都创新互联网站建设

关于创新互联

多方位宣传企业产品与服务 突出企业形象

公司简介 公司的服务 荣誉资质 新闻动态 联系我们

php查询整张表的数据,php表格显示数据库信息

php中用 mysql 查询整张表数据的代码?

?php

站在用户的角度思考问题,与客户深入沟通,找到芗城网站设计与芗城网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都网站建设、成都网站设计、企业官网、英文网站、手机端网站、网站推广、申请域名、网络空间、企业邮箱。业务覆盖芗城地区。

$conn=mysql_connect('localhost','root','root') or die("连接失败").mysql_error();//连接数据库

$select=mysql_select_db('数据库名称',$conn) or die("选择失败").mysql_error();//选择数据库

$ss="set names gbk";

$aa=mysql_query($ss);//设置显示中文

$str="select * from 表名";

$recstr=mysql_query($str);//执行查询

$row=mysql_fetch_row($recstr);

while($row)

{ echo $row[0].$row[1].$row[2];

$row=mysql_fetch_row($recstr);

?

php如何查询数据库表中的数据并显示

这个简单啊!

首页做个前台输入姓名和会员卡信息的页面,我做个简单的页面给你看

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "

html xmlns="

head

meta http-equiv="Content-Type" content="text/html; charset=utf-8" /

title会员查询系统/title

/head

body

form id="form1" name="form1" method="post" action="test.php"

p

label for="name"/label

input type="text" name="name" id="name" /

/p

p

label for="vipid"/label

input type="text" name="vipid" id="vipid" /

/p

p

input type="submit" name="button" id="button" value="查询" /

/p

/form

/body

/html

然后我给你一个test.php的文件代码:

?php

$name    =    trim($_POST['name']);

$vipid    =    trim($_POST['vipid']);

$con = mysql_connect("127.0.0.1","数据库用户名","数据库密码");

if (!$con)

{

die('Could not connect: ' . mysql_error());

}

$a    =    mysql_select_db("数据库名字", $con);

$sql    =    "select * from kh_customer where name = '$name' and vipid = '$vipid'";

$result = mysql_query($sql);

while($row = mysql_fetch_array($result))

{

echo $row['name'] . " " . $row['data'];

echo "br /";

}

mysql_close($con);

?

页面美化自己去搞!只能帮你这么多了

用PHP代码如何查询数据库表中的一条记录

你的意思是说

点击查询后

要吧与关键字相关联的整条记录都显示出来?

那样的话

你要先把这条记录复制

给某个数组,然后输出这个数组就可以了

$sql="select

*

from

db1

where

name=$_post[name]";

$result=mysql_query($sql,$con);

$row=mysql_fetch_array($result)

echo

$row[name];

echo

$row[age];

……

thinkphp 怎么查出一个数据库的表的所有数据

$goods = D('Goods');//实例化Model对象,实际操作Goods数据表

$info = $goods - select();//获得数据信息

print_r($info);//打印信息


新闻标题:php查询整张表的数据,php表格显示数据库信息
文章来源:http://kswsj.cn/article/hsjscd.html

其他资讯