$sql = 'SELECT COUNT( * ) FROM DAY WHERE id_u =1' ;
10余年的張家港網(wǎng)站建設(shè)經(jīng)驗(yàn),針對(duì)設(shè)計(jì)、前端、開發(fā)、售后、文案、推廣等六對(duì)一服務(wù),響應(yīng)快,48小時(shí)及時(shí)工作處理。成都全網(wǎng)營(yíng)銷的優(yōu)勢(shì)是能夠根據(jù)用戶設(shè)備顯示端的尺寸不同,自動(dòng)調(diào)整張家港建站的顯示方式,使網(wǎng)站能夠適用不同顯示終端,在瀏覽器中調(diào)整網(wǎng)站的寬度,無(wú)論在任何一種瀏覽器上瀏覽網(wǎng)站,都能展現(xiàn)優(yōu)雅布局與設(shè)計(jì),從而大程度地提升瀏覽體驗(yàn)。成都創(chuàng)新互聯(lián)從事“張家港網(wǎng)站設(shè)計(jì)”,“張家港網(wǎng)站推廣”以來(lái),每個(gè)客戶項(xiàng)目都認(rèn)真落實(shí)執(zhí)行。
$resault = $db-getAll($sql);
//
function getAll($sql)
{
$res = $this-query($sql);
if ($res !== false)
{
$arr = array();
while ($row = mysql_fetch_assoc($res))
{
$arr[] = $row;
}
return $arr;
}
else
{
return false;
}
}
//
function query($sql, $type = '')
{
if ($this-link_id === NULL)
{
$this-connect($this-settings['dbhost'], $this-settings['dbuser'], $this-settings['dbpw'], $this-settings['dbname'], $this-settings['charset'], $this-settings['pconnect']);
$this-settings = array();
}
if ($this-queryCount++ = 99)
{
$this-queryLog[] = $sql;
}
if ($this-queryTime == '')
{
if (PHP_VERSION = '5.0.0')
{
$this-queryTime = microtime(true);
}
else
{
$this-queryTime = microtime();
}
}
/* 當(dāng)當(dāng)前的時(shí)間大于類初始化時(shí)間的時(shí)候,自動(dòng)執(zhí)行 ping 這個(gè)自動(dòng)重新連接操作 */
if (PHP_VERSION = '4.3' time() $this-starttime + 1)
{
mysql_ping($this-link_id);
}
if (!($query = mysql_query($sql, $this-link_id)) $type != 'SILENT')
{
$this-error_message[]['message'] = 'MySQL Query Error';
$this-error_message[]['sql'] = $sql;
$this-error_message[]['error'] = mysql_error($this-link_id);
$this-error_message[]['errno'] = mysql_errno($this-link_id);
$this-ErrorMsg();
return false;
}
if (defined('DEBUG_MODE') (DEBUG_MODE 8) == 8)
{
$logfilename = $this-root_path . DATA_DIR . '/mysql_query_' . $this-dbhash . '_' . date('Y_m_d') . '.log';
$str = $sql . "\n\n";
if (PHP_VERSION = '5.0')
{
file_put_contents($logfilename, $str, FILE_APPEND);
}
else
{
$fp = @fopen($logfilename, 'ab+');
if ($fp)
{
fwrite($fp, $str);
fclose($fp);
}
}
}
return $query;
}
這個(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ì)員查詢系統(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è)面美化自己去搞!只能幫你這么多了
您好,PHP輸出數(shù)據(jù)有四種方式,echo、var_dump、print_r、retrun(這個(gè)一般是PHP框架常用)
文章題目:php簡(jiǎn)單搜索數(shù)據(jù)輸出 php搜索數(shù)據(jù)庫(kù)數(shù)據(jù)
網(wǎng)站鏈接:http://jinyejixie.com/article48/dossghp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供自適應(yīng)網(wǎng)站、響應(yīng)式網(wǎng)站、動(dòng)態(tài)網(wǎng)站、全網(wǎng)營(yíng)銷推廣、網(wǎng)站設(shè)計(jì)、外貿(mào)建站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)