一個用mysql_odbc和php寫的serach資料庫程式

來源:互聯網
上載者:User

<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 "查詢結果:";
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);
?>

///表結構
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");

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.