一个用mysql_odbc和php写的serach数据库程序
程序员文章站
2024-02-02 18:45:28
<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");
<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");
推荐阅读
-
一个用mysql_odbc和php写的serach数据库程序
-
windows上写PHP程序,一定要用记事本吗?白底黑字看着好眼晕呀,有像linux下的编辑器一个性质的软件可以用吗?求解
-
用php写的serv-u的web申请账号的程序,很烂,供参考,修改和删除请自己做了!这是个初稿,请多_PHP教程
-
一个用mysql_odbc和php写的serach数据库程序
-
用PHP和Shell写Hadoop的MapReduce程序
-
用PHP和Shell写Hadoop的MapReduce程序
-
一个用PHP代码写的2分查找程序
-
用PHP和MySQL构建一个数据库驱动的网站(六)
-
一个用PHP代码写的2分查找程序
-
一个用PHP代码写的2分查找程序