最基础的PHP分类查询程序
最初级的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="智慧销售" />
<input type="submit" name="manager" value="经营管理"/> <input type="submit" name="serve" value="智慧客服" /> <input type="submit" name="newemployee" value="智慧新员工" /> <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分类查询程序的更多相关文章
- C++ 容器的综合应用的一个简单实例——文本查询程序
C++ 容器的综合应用的一个简单实例——文本查询程序 [0. 需求] 最近在粗略学习<C++ Primer 4th>的容器内容,关联容器的章节末尾有个很不错的实例.通过实现一个简单的文本查 ...
- SQL-三级分类查询
/*SQLyog 企业版 - MySQL GUI v8.14 MySQL - 5.5.40 : Database - appinfodb******************************** ...
- php实现无限级分类查询(递归、非递归)
递归函数实现方式 上面提到,递归函数的也是借助于栈的机制实现的,但是底层对于栈的处理对于程序员来说都是透明的,程序员只需要关心应用的实现逻辑.所以说使用递归处理上述问题理解起来比较容易,代码也比较简洁 ...
- (2.8)Mysql之SQL基础——索引的分类与使用
(2.8)Mysql之SQL基础——索引的分类与使用 关键字:mysql索引,mysql增加索引,mysql修改索引,mysql删除索引 按逻辑分类: 1.主键索引(聚集索引)(也是唯一索引,不允许有 ...
- python基础——重访类型分类
python基础--重访类型分类 对象根据分类来共享操作:例如,字符串.列表和元组都共享诸如合并.长度和索引等序列操作. 只有可变对象(列表.字典和集合)可以原处修改:我们不能原处修改数字,字符串.元 ...
- SQL 语句与性能之联合查询和联合分类查询
select * from t1 left join t2 on t2.sysno =t1.ASysNo left join t3 on t3.sysno =t2.ASysNo left join t ...
- 基于php基础语言编写的小程序之计算器
基于php基础语言编写的小程序之计算器 需求:在输入框中输入数字进行加.减.乘.除运算(html+php) 思路: 1首先要创建输入数字和运算符的输入框,数字用input的text属性,运算符用sel ...
- 【T-SQL基础】02.联接查询
概述: 本系列[T-SQL基础]主要是针对T-SQL基础的总结. [T-SQL基础]01.单表查询-几道sql查询题 [T-SQL基础]02.联接查询 [T-SQL基础]03.子查询 [T-SQL基础 ...
- 【T-SQL基础】03.子查询
以前总是追求新东西,发现基础才是最重要的,今年主要的目标是精通SQL查询和SQL性能优化. 本系列[T-SQL基础]主要是针对T-SQL基础的总结. [T-SQL基础]01.单表查询-几道sql查询题 ...
随机推荐
- canvas锯齿
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- init: cannot execve(‘XXX’):Permission denied问题
近期在给android 4.3系统进行root时候,一直出现例如以下的红色权限问题 : 7.695741] Freeing init memory: 236K [ 8.555286] ini ...
- HTTP协议发展历史
一.HTTP 0.9版本 1991年发布0.9版本,只有一个 GET 命令. 例如:GET /index.html 表示浏览器只能接收返回 html 格式的字符串:服务器发送完毕就关闭tcp链接. ...
- python3 JSON对象的学习
import jsonname = { 'alex':[22,'M'], 'tony':[21,'F'],} name_after = json.dumps(name)name_after = nam ...
- MVC数据验证Model Validation
Required必须项验证属性 [Required] public string FirstName { get; set; } //ID编号 [ScaffoldColumn(false)] [Req ...
- freeswitch 音 视频 支持的编码
FreeSWITCH 支持很多的语音编解码:[13] PCMU – G.711 µ-law PCMA – G.711 A-law G.722 G.722.1 G.722.1c G.726 G.726 ...
- Selenium自動化測試(Python+VS2013)-基礎篇-環境安裝
Python+VS2013環境安裝 http://www.cnblogs.com/aehyok/p/3986168.html PTVS: http://microsoft.github.io/PTVS ...
- SELinux 宽容模式(permissive) 强制模式(enforcing) 关闭(disabled)
SElinux共有3中状态.1.selinux的配置文件:/etc/selinux/config# This file controls the state of SELinux on the sys ...
- iOS7 SDK新特性
春风又绿加州岸.物是人非又一年.WWDC 2013 keynote落下帷幕,新的iOS开发旅程也由此开启.在iOS7界面重大变革的背后,开发人员们须要知道的又有哪些呢.同去年一样,我会先简单纵览地介绍 ...
- python模块学习之warnings
warnings.warn(message, category=None, stacklevel=, source=None) 发出警告,或者忽略它或引发异常. category参数(如果给定)必须是 ...