這個簡單啊!
從事重慶服務(wù)器托管,服務(wù)器租用,云主機(jī),網(wǎng)站空間,域名注冊,CDN,網(wǎng)絡(luò)代維等服務(wù)。
首頁做個前臺輸入姓名和會員卡信息的頁面,我做個簡單的頁面給你看
!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會員查詢系統(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
然后我給你一個test.php的文件代碼:
?php
$name????=????trim($_POST['name']);
$vipid????=????trim($_POST['vipid']);
$con?=?mysql_connect("127.0.0.1","數(shù)據(jù)庫用戶名","數(shù)據(jù)庫密碼");
if?(!$con)
{
die('Could?not?connect:?'?.?mysql_error());
}
$a????=????mysql_select_db("數(shù)據(jù)庫名字",?$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);
?
頁面美化自己去搞!只能幫你這么多了
沒這么干過 mysql_list_tables 獲取 所有表信息 返回指針 mysql_tablename 獲取表名
myslq_num_rows函數(shù)來判斷結(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);
? 這是手冊上例子 后邊的不用我說了吧 sql查詢
你的表與表之間有沒有關(guān)聯(lián)?
如果有關(guān)聯(lián)的話,,可以寫成一個SQL語句
將查詢結(jié)果賦予一個數(shù)組
然后遍歷數(shù)據(jù)
將遍歷結(jié)果 賦在指定的位置中 就實現(xiàn)了你的功能
首先,向你介紹一下information_schema。
information_schema這張數(shù)據(jù)表保存了MySQL服務(wù)器所有數(shù)據(jù)庫的信息。如數(shù)據(jù)庫名,數(shù)據(jù)庫的表,表欄的數(shù)據(jù)類型與訪問權(quán)限等。再簡單點(diǎn),這臺MySQL服務(wù)器上,到底有哪些數(shù)據(jù)庫、各個數(shù)據(jù)庫有哪些表,每張表的字段類型是什么,各個數(shù)據(jù)庫要什么權(quán)限才能訪問,等等信息都保存在information_schema表里面。
所以,你需要查表信息應(yīng)該去這個庫查
sql語句是
select * from information_schema.tables where table_schema='dbname';
希望采納,祝您愉快!
網(wǎng)站標(biāo)題:php查詢數(shù)據(jù)庫的表數(shù) php查詢數(shù)據(jù)庫表數(shù)據(jù)
網(wǎng)站地址:http://www.chinadenli.net/article20/dddodjo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站設(shè)計公司、用戶體驗、網(wǎng)站制作、服務(wù)器托管、關(guān)鍵詞優(yōu)化、移動網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)