当前位置: 首页 > 图文教程 > 网络编程 > PHP > 一个用mysql_odbc和php写的serach数据库程序

PHP
PHP新手上路(九)
来自PHP.NET的入门教程
PHP新手上路(十)
Apache, PHP在Windows 9x/NT下的安装与配置 (二)
别人整理的服务器变量:$_SERVER
APMServ使用说明
《APMServ 5.1.2》使用图解
一个可以找出源代码中所有中文的工具
php.ini 中文版
MYSQL数据库初学者使用指南
第一节--面向对象编程
第二节--PHP5 的对象模型
第三节--定义一个类
第四节--构造函数和析构函数
第五节--克隆
第六节--访问属性和方法
第七节--类的静态成员
第八节--访问方式
第九节--绑定
第十节--抽象方法和抽象类

PHP 中的 一个用mysql_odbc和php写的serach数据库程序


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-09-13   浏览: 111 ::
收藏到网摘: n/a

<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");