当前位置:Gxlcms > PHP教程 > 一个用mysql_odbc和php写的serach数据库程序

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

时间:2021-07-01 10:21:17 帮助过:30人阅读

 

 
 
查询条件 
 
 

 

查询条件

 

 
 
 

//后台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"); 

人气教程排行