這個(gè)簡(jiǎn)單??!
成都創(chuàng)新互聯(lián)公司是創(chuàng)新、創(chuàng)意、研發(fā)型一體的綜合型網(wǎng)站建設(shè)公司,自成立以來(lái)公司不斷探索創(chuàng)新,始終堅(jiān)持為客戶提供滿意周到的服務(wù),在本地打下了良好的口碑,在過(guò)去的十余年時(shí)間我們累計(jì)服務(wù)了上千家以及全國(guó)政企客戶,如公路鉆孔機(jī)等企業(yè)單位,完善的項(xiàng)目管理流程,嚴(yán)格把控項(xiàng)目進(jìn)度與質(zhì)量監(jiān)控加上過(guò)硬的技術(shù)實(shí)力獲得客戶的一致贊譽(yù)。
首頁(yè)做個(gè)前臺(tái)輸入姓名和會(huì)員卡信息的頁(yè)面,我做個(gè)簡(jiǎn)單的頁(yè)面給你看
!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會(huì)員查詢系統(tǒng)/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
然后我給你一個(gè)test.php的文件代碼:
?php
$name????=????trim($_POST['name']);
$vipid????=????trim($_POST['vipid']);
$con?=?mysql_connect("127.0.0.1","數(shù)據(jù)庫(kù)用戶名","數(shù)據(jù)庫(kù)密碼");
if?(!$con)
{
die('Could?not?connect:?'?.?mysql_error());
}
$a????=????mysql_select_db("數(shù)據(jù)庫(kù)名字",?$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);
?
頁(yè)面美化自己去搞!只能幫你這么多了
用table/table就可以了啊,然后用PHP的逐條輸出數(shù)據(jù)語(yǔ)句相結(jié)合,你圖太小,根本看不清,不過(guò)道理就是這么個(gè)道理的
?php
//設(shè)置編碼格式
header("Content-type:text/html;charset=utf-8");
//鏈接數(shù)據(jù)庫(kù)
$conn = mysql_connect("localhost","root","");
//選擇要操作的數(shù)據(jù)庫(kù)
mysql_select_db('act1',$conn);
//設(shè)置操作數(shù)據(jù)庫(kù)編碼格式
mysql_query("set names utf8");
//執(zhí)行查詢操作
$re= mysql_query("select user_name,phone from user");
?
table border='1px'
!-- 表格頭部 --
tr
td用戶名/tdtd電話/td
/tr
?php
//每循環(huán)一次,取一行數(shù)據(jù)記錄顯示在一行中
while($row=@mysql_fetch_row($re)){
?
tr
td?php echo $row[0];?/tdtd?php echo $row[1];?/td
/tr
?php
}?? ?
?
/table
顯示結(jié)果如下:
html
head
title瀏覽表中記錄/title
/head
body
center
?php
$db_host=localhost; //MYSQL服務(wù)器名
$db_user=root; //MYSQL用戶名
$db_pass=""; //MYSQL用戶對(duì)應(yīng)密碼
$db_name="test"; //要操作的數(shù)據(jù)庫(kù)
//使用mysql_connect()函數(shù)對(duì)服務(wù)器進(jìn)行連接,如果出錯(cuò)返回相應(yīng)信息
$link=mysql_connect($db_host,$db_user,$db_pass)or die("不能連接到服務(wù)器".mysql_error());
mysql_select_db($db_name,$link); //選擇相應(yīng)的數(shù)據(jù)庫(kù),這里選擇test庫(kù)
$sql="select * from test1"; //先執(zhí)行SQL語(yǔ)句顯示所有記錄以與插入后相比較
$result=mysql_query($sql,$link); //使用mysql_query()發(fā)送SQL請(qǐng)求
echo "當(dāng)前表中的記錄有:";
echo "table border=1"; //使用表格格式化數(shù)據(jù)
echo "trtdID/tdtd姓名/tdtd郵箱/tdtd電話/tdtd地址/td/tr";
while($row=mysql_fetch_array($result)) //遍歷SQL語(yǔ)句執(zhí)行結(jié)果把值賦給數(shù)組
{
echo "tr";
echo "td".$row[id]."/td"; //顯示ID
echo "td".$row[name]." /td"; //顯示姓名
echo "td".$row[mail]." /td"; //顯示郵箱
echo "td".$row[phone]." /td"; //顯示電話
echo "td".$row[address]." /td"; //顯示地址
echo "/tr";
}
echo "/table";
?
/center
/body
/html