一個(gè)用mysql_odbc和php寫(xiě)的serach數(shù)據(jù)庫(kù)程序
更新時(shí)間:2006年10月09日 00:00:00 作者:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查詢條件</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body bgcolor="#fcf8c2">
<p>查詢條件 </p>
<form action="searchyh.php" method="post">
<table border="1" width="43%" height="34">
<tr>
<td width="100%" height="28">用戶名稱: <input type="text" name="name" size="20"></td>
<td width="100%" height="28">用戶地址: <input type="text" name="add" size="20"></td>
<td width="100%" height="28">用戶電話: <input type="text" name="tel" size="20"></td>
</tr>
</table>
<p><input type="submit" value="提交查詢"> </p>
</form>
</body>
</html>
//后臺(tái)PHP
<?php
echo "<body bgcolor='#fcf8c2'>";
echo "查詢結(jié)果:";
echo "
";
echo "
";
$conn = odbc_connect("blue", "root", "");
$name .="%";
$add .="%";
$tel .="%";
$query = "select * ";
$query .= "from jc_yh where (name like '$name' and address like'$add' and tel like '$tel' )";
odbc_result_all( odbc_do($conn, $query), "border=1 width=50%");
odbc_close($conn);
?>
///表結(jié)構(gòu)
CREATE TABLE jc_yh (
id int not null default 0,
name varchar(80) not null default "blue",
city varchar(40) not null default "xn",
tel varchar(14) not null default "00000000000000",
fax varchar(14) not null default "00000000000000",
address varchar(60) not null default "xn",
post varchar(6) not null default "000000");
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>查詢條件</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
</head>
<body bgcolor="#fcf8c2">
<p>查詢條件 </p>
<form action="searchyh.php" method="post">
<table border="1" width="43%" height="34">
<tr>
<td width="100%" height="28">用戶名稱: <input type="text" name="name" size="20"></td>
<td width="100%" height="28">用戶地址: <input type="text" name="add" size="20"></td>
<td width="100%" height="28">用戶電話: <input type="text" name="tel" size="20"></td>
</tr>
</table>
<p><input type="submit" value="提交查詢"> </p>
</form>
</body>
</html>
//后臺(tái)PHP
<?php
echo "<body bgcolor='#fcf8c2'>";
echo "查詢結(jié)果:";
echo "
";
echo "
";
$conn = odbc_connect("blue", "root", "");
$name .="%";
$add .="%";
$tel .="%";
$query = "select * ";
$query .= "from jc_yh where (name like '$name' and address like'$add' and tel like '$tel' )";
odbc_result_all( odbc_do($conn, $query), "border=1 width=50%");
odbc_close($conn);
?>
///表結(jié)構(gòu)
CREATE TABLE jc_yh (
id int not null default 0,
name varchar(80) not null default "blue",
city varchar(40) not null default "xn",
tel varchar(14) not null default "00000000000000",
fax varchar(14) not null default "00000000000000",
address varchar(60) not null default "xn",
post varchar(6) not null default "000000");
相關(guān)文章
PHP和Mysqlweb應(yīng)用開(kāi)發(fā)核心技術(shù)-第1部分 Php基礎(chǔ)-2 php語(yǔ)言介紹
PHP和Mysqlweb應(yīng)用開(kāi)發(fā)核心技術(shù)-第1部分 Php基礎(chǔ)-2php語(yǔ)言說(shuō)明,學(xué)習(xí)php的朋友繼續(xù)跟進(jìn)吧。2011-07-07PHP4與PHP3中一個(gè)不兼容問(wèn)題的解決方法
PHP4與PHP3中一個(gè)不兼容問(wèn)題的解決方法...2006-10-10php入門學(xué)習(xí)知識(shí)點(diǎn)四 PHP正則表達(dá)式基本應(yīng)用
php入門學(xué)習(xí)知識(shí)點(diǎn)四 PHP正則表達(dá)式基本應(yīng)用,正則也是php中常用的,大家一定要掌握下。不會(huì)的可以到腳本之家首頁(yè)查看正則基礎(chǔ)教材。2011-07-07PHP bin2hex()函數(shù)基礎(chǔ)實(shí)例講解
今天小編就為大家分享一篇關(guān)于PHP bin2hex()函數(shù)基礎(chǔ)實(shí)例講解,小編覺(jué)得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來(lái)看看吧2019-02-02第4章 數(shù)據(jù)處理-php正則表達(dá)式-鄭阿奇(續(xù))
第4章 數(shù)據(jù)處理-php正則表達(dá)式-鄭阿奇(續(xù)) ,學(xué)習(xí)php正則表達(dá)式的朋友可以參考下。php正則是比較不錯(cuò)應(yīng)用。2011-07-07選擇PHP作為網(wǎng)站開(kāi)發(fā)語(yǔ)言的原因分享
如今大多數(shù)的編程語(yǔ)言都能夠有效的處理復(fù)雜的任務(wù),支持多種數(shù)據(jù)庫(kù)并且兼容于多平臺(tái)。但是,當(dāng)一個(gè)網(wǎng)站選擇用何種語(yǔ)言開(kāi)發(fā)時(shí)應(yīng)當(dāng)更注重語(yǔ)言的成本和靈活性2012-01-01NT IIS下用ODBC連接數(shù)據(jù)庫(kù)
NT IIS下用ODBC連接數(shù)據(jù)庫(kù)...2006-10-10