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

6年以前  |  阅读数:957 次  |  编程语言:PHP 
查询条件

查询条件

用户名称: 用户地址: 用户电话:

//后台PHP
<?php
echo "";
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");

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8