一个用mysql_odbc和php写的serach数据库程序
<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");
如对本文有疑问,
点击进行留言回复!!
相关文章:
-
-
-
-
管理后台无限级菜单
管理后台菜单遍历很久就想做一个通用的管理后台出来,一直太懒没做,今天开始粗略搞了一下,只是先把框架搭建好,菜单栏...
[阅读全文]
-
桥接模式学习总结
桥接模式引言假如一个系统需要加入报表模块,主要的开发点是数据的获取和报表的显示方式。数据的获取可能是从系统数据库...
[阅读全文]
-
-
-
-
-
-
网友评论