最初级的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. PgSql备份pg_dump与还原手记pg_restore(转)

    可以直接跳转至最后面的示例进行查看 真没有想到,以前一直是PostgreSQL使用者,突然需要库移植又成了头一招了!原来它与mysql命令行操作区别还挺大. 不用怕,但绝对要细心,因为数据库操作是网站 ...

  2. dmesg 时间转换脚本

    https://linuxaria.com/article/how-to-make-dmesg-timestamp-human-readable perl脚本 #!/usr/bin/perl use ...

  3. hibernate 关系映射之 双向外键关联一对一

    在上一篇博客内容的基础上做了以下修改,即可实现.   注解方式:   package com.bjsxt.hibernate; import javax.persistence.Entity; imp ...

  4. 【Spark】Spark的Standalone模式安装部署

    Spark执行模式 Spark 有非常多种模式,最简单就是单机本地模式,还有单机伪分布式模式,复杂的则执行在集群中,眼下能非常好的执行在 Yarn和 Mesos 中.当然 Spark 还有自带的 St ...

  5. C#下载apk文件

    string fileName = "name.apk";//客户端保存的文件名         string filePath = Server.MapPath("ap ...

  6. zabbix报错listener failed: zbx_tcp_listen() fatal error: unable to serve on any address

    I'm trying to install zabbix on a new (virtual) server. But i have troubles with the zabbix_agentd o ...

  7. 要练习的lambda

    取list的id 放入新List<Integer> List<Integer> list1 = list.stream().map(albumGroup1 -> albu ...

  8. python \uxxxx转中文,Python列表中的字典 \uxxxx转中文,

    import json a = [{u', u'roleFlag': 7}] print json.dumps(a).decode("unicode_escape") 输出结果是: ...

  9. Error: Could not find or load main class org.apache.flume.tools.GetJavaProperty

    问题: [root@master conf]# flume-ng version Error: Could not find or load main class org.apache.flume.t ...

  10. sourceInsight设置

    复制后光标定格在行尾 Options -> Preferences -> Typing -> After pasting,select:at end of pasted text t ...