<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");
您可能感兴趣的文章:PHP如何透过ODBC来存取数据库php连接odbc数据源并保存与查询数据的方法php常用ODBC函数集(详细)php5.3中连接sqlserver2000的两种方法(com与ODBC)一个PHP操作Access类(PHP+ODBC+Access)用PHP实现ODBC数据分页显示一例用php和MySql来与ODBC数据连接PHP使用ODBC连接数据库的方法
odbc
程序
PHP
Mysql