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

2016-01-29 14:27 7 1 收藏

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

【 tulaoshi.com - PHP 】

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

来源:https://www.tulaoshi.com/n/20160129/1493355.html

延伸阅读
标签: MySQL mysql数据库
使用MYSQL进行数据库备份,又很正规的数据库备份方法,同其他的数据库服务器有相同的概念,但有没有想过,MySQL会有更简捷的使用文件目录的备份方法,而且又快有好。 一、数据备份捷径 因为这个方法没有得到官方正式文档的验证,我们暂称为试验吧。 目的:备份hostA主机中一个mysql数据库TestA,并恢复到到hostB机中 试验环境: 操作...
标签: PHP
 使用的环境 先建立一个测试用的数据库 接着建立一个ODBC连结 再建个测试用的PHP Script 咱们来测试吧 使用的环境 本文件主要是在Win32的环境下作说明, 您需要的是台跑Windows 9x/NT/2000的计算机, 并装有任何一种web server和PHP3或PHP4, 且可正确执行PHP Script. 并有一种以上的SQL数据库软件, 例如:Access... 本文...
标签: PHP
  <?php // // SourceForge: Breaking Down the Barriers to Open Source Development // Copyright 1999-2000 (c) The SourceForge Crew // http://sourceforge.net // // $Id: database.php,v 1.6 2000/04/11 14:17:13 cvs Exp $ // // /etc/local.inc includes the machine specific database connect info function db_c...
标签: ASP
       To assist in interfacing with databases. This script can format variables and return SQL formats. Such as double quoting apposterphies and surrounding strings with quotes, Returning NULL for invalid data types, trimming strings so they do not exceed maximum lengths. This also ha...
1、使用SHOW语句找出在服务器上当前存在什么数据库: mysql SHOW DATABASES; +----------+ | Database | +----------+ | mysql | | test | +----------+ 3 rows in set (0.00 sec)  2、创建一个数据库abccs mysql CREATE DATABASE abccs; 注意不同操作系统对大小写的敏感。 3、选择你所创建的数据库...

经验教程

60

收藏

80
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部