最初级的PHP分类查询程序

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head> <body> <div align="center"><form action="<?php $_SERVER['PHP_SELF'];?>" method="post"><input type="submit" name="sell" value="智慧销售" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="manager" value="经营管理"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="serve" value="智慧客服" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="newemployee" value="智慧新员工" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="submit" name="development" value="个人发展" /></form> <?php
if(!empty($_POST['sell'])){ $conn=mysql_connect("localhost","root","root");
if(!$conn){
die('Could not connect the database!');
}
mysql_query("SET NAMES UTF8");
mysql_query("set character_set_client=utf8");
mysql_query("set character_set_results=utf8");
mysql_select_db("test",$conn);
$sql="select * from ts1 where name like '%智慧销售%' ";
$result=mysql_query($sql);
echo '<table height="60%" width="60%" border="1" align="center">';
while($row=mysql_fetch_assoc($result)){
echo '<tr height="45px">';
echo '<td>'.$row['id'].'</td>'.'<td>'.$row['name'].'</td>'.'<td>'.$row['image'].'</td>';
echo '</tr>';
}
echo '</table>';
mysql_close($conn);
} / / http://www.pprar.com
?>
<?php
if(!empty($_POST['serve'])){ $conn=mysql_connect("localhost","root","root");
if(!$conn){
die('Could not connect the database!');
}
mysql_query("SET NAMES UTF8");
mysql_query("set character_set_client=utf8");
mysql_query("set character_set_results=utf8");
mysql_select_db("test",$conn);
$sql="select * from ts1 where name like '%智慧客服%' ";
$result=mysql_query($sql);
echo '<table height="60%" width="60%" border="1" align="center">';
while($row=mysql_fetch_assoc($result)){
echo '<tr height="45px">';
echo '<td>'.$row['id'].'</td>'.'<td>'.$row['name'].'</td>'.'<td>'.$row['image'].'</td>';
echo '</tr>';
}
echo '</table>';
mysql_close($conn);
} ?> <?php
if(!empty($_POST['manager'])){ $conn=mysql_connect("localhost","root","root");
if(!$conn){
die('Could not connect the database!');
}
mysql_query("SET NAMES UTF8");
mysql_query("set character_set_client=utf8");
mysql_query("set character_set_results=utf8");
mysql_select_db("test",$conn);
$sql="select * from ts1 where name like '%经营管理%' ";
$result=mysql_query($sql);
echo '<table height="60%" width="60%" border="1" align="center">';
while($row=mysql_fetch_assoc($result)){
echo '<tr height="45px">';
echo '<td>'.$row['id'].'</td>'.'<td>'.$row['name'].'</td>'.'<td>'.$row['image'].'</td>';
echo '</tr>';
}
echo '</table>';
mysql_close($conn);
} ?> <?php
if(!empty($_POST['newemployee'])){ $conn=mysql_connect("localhost","root","root");
if(!$conn){
die('Could not connect the database!');
}
mysql_query("SET NAMES UTF8");
mysql_query("set character_set_client=utf8");
mysql_query("set character_set_results=utf8");
mysql_select_db("test",$conn);
$sql="select * from ts1 where name like '%智慧新员工%'";
$result=mysql_query($sql);
echo '<table height="60%" width="60%" border="1" align="center">';
while($row=mysql_fetch_assoc($result)){
echo '<tr height="45px">';
echo '<td>'.$row['id'].'</td>'.'<td>'.$row['name'].'</td>'.'<td>'.$row['image'].'</td>';
echo '</tr>';
}
echo '</table>';
mysql_close($conn);
} ?> <?php
if(!empty($_POST['development'])){ $conn=mysql_connect("localhost","root","root");
if(!$conn){
die('Could not connect the database!');
}
mysql_query("SET NAMES UTF8");
mysql_query("set character_set_client=utf8");
mysql_query("set character_set_results=utf8");
mysql_select_db("test",$conn);
$sql="select * from ts1 where name like '%个人发展%' ";
$result=mysql_query($sql);
echo '<table height="60%" width="60%" border="1" align="center">';
while($row=mysql_fetch_assoc($result)){
echo '<tr height="45px">';
echo '<td>'.$row['id'].'</td>'.'<td>'.$row['name'].'</td>'.'<td>'.$row['image'].'</td>';
echo '</tr>';
}
echo '</table>';
mysql_close($conn);
} ?>
</div>
</body>
</html>

最基础的PHP分类查询程序的更多相关文章

  1. C++ 容器的综合应用的一个简单实例——文本查询程序

    C++ 容器的综合应用的一个简单实例——文本查询程序 [0. 需求] 最近在粗略学习<C++ Primer 4th>的容器内容,关联容器的章节末尾有个很不错的实例.通过实现一个简单的文本查 ...

  2. SQL-三级分类查询

    /*SQLyog 企业版 - MySQL GUI v8.14 MySQL - 5.5.40 : Database - appinfodb******************************** ...

  3. php实现无限级分类查询(递归、非递归)

    递归函数实现方式 上面提到,递归函数的也是借助于栈的机制实现的,但是底层对于栈的处理对于程序员来说都是透明的,程序员只需要关心应用的实现逻辑.所以说使用递归处理上述问题理解起来比较容易,代码也比较简洁 ...

  4. (2.8)Mysql之SQL基础——索引的分类与使用

    (2.8)Mysql之SQL基础——索引的分类与使用 关键字:mysql索引,mysql增加索引,mysql修改索引,mysql删除索引 按逻辑分类: 1.主键索引(聚集索引)(也是唯一索引,不允许有 ...

  5. python基础——重访类型分类

    python基础--重访类型分类 对象根据分类来共享操作:例如,字符串.列表和元组都共享诸如合并.长度和索引等序列操作. 只有可变对象(列表.字典和集合)可以原处修改:我们不能原处修改数字,字符串.元 ...

  6. SQL 语句与性能之联合查询和联合分类查询

    select * from t1 left join t2 on t2.sysno =t1.ASysNo left join t3 on t3.sysno =t2.ASysNo left join t ...

  7. 基于php基础语言编写的小程序之计算器

    基于php基础语言编写的小程序之计算器 需求:在输入框中输入数字进行加.减.乘.除运算(html+php) 思路: 1首先要创建输入数字和运算符的输入框,数字用input的text属性,运算符用sel ...

  8. 【T-SQL基础】02.联接查询

    概述: 本系列[T-SQL基础]主要是针对T-SQL基础的总结. [T-SQL基础]01.单表查询-几道sql查询题 [T-SQL基础]02.联接查询 [T-SQL基础]03.子查询 [T-SQL基础 ...

  9. 【T-SQL基础】03.子查询

    以前总是追求新东西,发现基础才是最重要的,今年主要的目标是精通SQL查询和SQL性能优化. 本系列[T-SQL基础]主要是针对T-SQL基础的总结. [T-SQL基础]01.单表查询-几道sql查询题 ...

随机推荐

  1. BroadcastReceiver应用详解——广播

    转自:http://blog.csdn.net/liuhe688/article/details/6955668 BroadcastReceiver也就是“广播接收者”的意思,顾名思义,它就是用来接收 ...

  2. vfork & fork

    转载 http://coolshell.cn/articles/12103.html 在知乎上,有个人问了这样的一个问题——为什么vfork的子进程里用return,整个程序会挂掉,而且exit()不 ...

  3. lspci查看硬件信息时提示找不到命令

    系统环境:centos 6.3 X64 错误信息:[root@localhost ~]# lspci-bash: lspci: command not found 问题原因:这是因为没有安装pciut ...

  4. 【微信小程序】日历插件,适用于酒店订房类小程序

    本插件在原作者(传送门:http://blog.csdn.net/lengyue1084/article/details/71248778)基础上升级. 增加了点击选择具体日期和数据传输功能. 效果图 ...

  5. spring jdbc框架

    spring+jdbc 1.jdbc编程的特点: 模板编程 固定代码+动态的参数 spring产生dataSource JdbcTemplate{//模板编程 private DataSource d ...

  6. [机器学习实战] k邻近算法

    1. k邻近算法原理: 存在一个样本数据集,也称作训练样本集,并且样本集中每个数据都存在标签,即我们知道样本集中每一数据与所属分类的对应关系.输入没有标签的新数据后,将新数据的每个特征与样本集中数据对 ...

  7. 数据库表syscolumns 各个字段含义 select * from syscolumns where name='textA'

    每个数据库创建后都会有一些系统表用来存储该数据库的一些基本信息 每个表和视图中的每列在表中占一行,存储过程中的每个参数在表中也占一行.该表位于每个数据库中. 列名 数据类型 描述 name sysna ...

  8. ubuntu安装Skype 4.3

    Install Skype 4.3 Step 1: Remove previous version sudo apt-get remove skype skype-bin:i386 skype:i38 ...

  9. [emqttd] (EMQ)

    [emqttd] (EMQ)是采用Erlang语言开发,全面支持MQTT V3.1.1协议,支持集群和大规模连接的开源MQTT消息服务器. [emqttd]致力于发布一个基于Erlang/OTP语言平 ...

  10. PhpStorm和PHPstudy配置调试参数(Xdebug),问题描述Error. Interpreter is not specified or invalid. Press “Fix” to edit your project configuration.

    配置phpstrom的Xdebug 问题描述: Error. Interpreter is not specified or invalid. Press "Fix" to edi ...