一個(gè)用mysql_odbc和php寫的serach數(shù)據(jù)庫程序
更新時(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>
//后臺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>
//后臺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)用開發(fā)核心技術(shù)-第1部分 Php基礎(chǔ)-2 php語言介紹
PHP和Mysqlweb應(yīng)用開發(fā)核心技術(shù)-第1部分 Php基礎(chǔ)-2php語言說明,學(xué)習(xí)php的朋友繼續(xù)跟進(jìn)吧。2011-07-07php入門學(xué)習(xí)知識點(diǎn)四 PHP正則表達(dá)式基本應(yīng)用
php入門學(xué)習(xí)知識點(diǎn)四 PHP正則表達(dá)式基本應(yīng)用,正則也是php中常用的,大家一定要掌握下。不會的可以到腳本之家首頁查看正則基礎(chǔ)教材。2011-07-07PHP bin2hex()函數(shù)基礎(chǔ)實(shí)例講解
今天小編就為大家分享一篇關(guān)于PHP bin2hex()函數(shù)基礎(chǔ)實(shí)例講解,小編覺得內(nèi)容挺不錯(cuò)的,現(xiàn)在分享給大家,具有很好的參考價(jià)值,需要的朋友一起跟隨小編來看看吧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