foreach($arr?as?$key=$val){

創(chuàng)新互聯(lián)公司專(zhuān)業(yè)為企業(yè)提供南票網(wǎng)站建設(shè)、南票做網(wǎng)站、南票網(wǎng)站設(shè)計(jì)、南票網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁(yè)設(shè)計(jì)與制作、南票企業(yè)網(wǎng)站模板建站服務(wù),10年南票做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。
$str?=?$val['$key']."br/";
}
echo?$str;
這個(gè)簡(jiǎn)單啊!
首頁(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ì)員查詢(xún)系統(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="查詢(xún)"?/
/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ù)用戶(hù)名","數(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è)面美化自己去搞!只能幫你這么多了
$db?=?new?mysqli(.......);//數(shù)據(jù)庫(kù)連接你自己寫(xiě)
$db?-?query('SET?NAMES?數(shù)據(jù)編碼');
$Rel?=?$db?-?query('select?*?from?表名稱(chēng)');
while?(?$rs?=?$Rel?-?fetch_array()?)?{
echo?$rs['字段名稱(chēng)'];
}
$goods = D('Goods');//實(shí)例化Model對(duì)象,實(shí)際操作Goods數(shù)據(jù)表
$info = $goods - select();//獲得數(shù)據(jù)信息
print_r($info);//打印信息
沒(méi)這么干過(guò)
mysql_list_tables
獲取
所有表信息
返回指針
mysql_tablename
獲取表名
myslq_num_rows函數(shù)來(lái)判斷結(jié)果指針中的表的數(shù)目
?php
mysql_connect("localhost",
"mysql_user",
"mysql_password");
$result
=
mysql_list_tables("mydb");
for
($i
=
0;
$i
mysql_num_rows($result);
$i++)
printf
("Table:
%s\n",
mysql_tablename($result,
$i));
mysql_free_result($result);
?
這是手冊(cè)上例子
后邊的不用我說(shuō)了吧
sql查詢(xún)
這個(gè)查到了三組數(shù)據(jù),但是只能輸出一組,原因很簡(jiǎn)單,是因?yàn)?$qstr 這是一個(gè)數(shù)組,你要想全部顯示出來(lái),需要循環(huán)才可以
新聞標(biāo)題:php查看表中所有數(shù)據(jù),php查詢(xún)數(shù)據(jù)庫(kù)內(nèi)容表格
分享URL:http://chinadenli.net/article25/dsidcji.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站收錄、企業(yè)建站、外貿(mào)網(wǎng)站建設(shè)、面包屑導(dǎo)航、網(wǎng)站導(dǎo)航、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)