2016年12月27日

case when

摘要: SELECT * FROM category WHERE EXISTS (SELECT * FROM goods WHERE goods.cat_id = category.cat_id) category 栏目表 goods 文章表 表名: city 序号 字段名 字段类型 允许为空 默认值 备注 阅读全文

posted @ 2016-12-27 14:56 炊厨 阅读(103) 评论(0) 推荐(0)

mysql总结

摘要: //查询日期之前的差距 select user_name , from_unixtime(user_lastlogin_time),now() , year(now())-year( from_unixtime(user_lastlogin_time)) - (RIGHT(CURDATE(),5)< 阅读全文

posted @ 2016-12-27 14:55 炊厨 阅读(144) 评论(0) 推荐(0)

触发器事件trigger

摘要: 修改mysql结束符 delimiter name 触发器语法: create trigger 触发器名称 after/before 触发时间 //错误 ERROR 1362 (HY000): Updating of NEW row is not allowed in after trigger i 阅读全文

posted @ 2016-12-27 14:54 炊厨 阅读(411) 评论(0) 推荐(0)

存储过程procedure

摘要: 存储过程(procedure) 修改mysql结束符 delimiter name procedure创建语法: create procedure procedureName(); begin declare 声明变量 sql语句 end$ 查看:procedure show procedure s 阅读全文

posted @ 2016-12-27 14:53 炊厨 阅读(261) 评论(0) 推荐(0)

事件event_scheduler

摘要: 1.查看事件是否开启 1-1.show variables like 'event_scheduler'; 1-2.select @@event_scheduler; 1-3.show processlist; 如果event_scheduler=off 没有开启 on开启 1-4开启event_s 阅读全文

posted @ 2016-12-27 14:51 炊厨 阅读(5353) 评论(0) 推荐(0)

MYSQL权限表user操作强制更改密码需重启wamp

摘要: MYSQL权限表user cmd中进人mysql找到mysql安装目录 E:\wamp\bin\mysql\mysql5.6.12\bin>mysql.exe -u 用户名 -p密码 cmd查看ip ipconfig 修改密码 1.update user set password=password( 阅读全文

posted @ 2016-12-27 14:51 炊厨 阅读(309) 评论(0) 推荐(0)

mysql优化思路

摘要: /* mysql优化思路 1.数据库设计 2.sql语句优化 3.数据库参数设置 4.恰当的硬件资源和操作系统 数据库设计 数据的3NF(3范式) 逆范式 3NF解释 1NF:就是具有原子性,不可分割。(只要使用的是关系型数据库,就自动符合) 2NF:在满足1NF的基础上,我们考虑是否满足2NF,只 阅读全文

posted @ 2016-12-27 14:50 炊厨 阅读(149) 评论(0) 推荐(0)

MYSQL的事务处理

摘要: $conn = mysql_connect('localhost','root','')or die("数据库连接错误!!!"); mysql_select_db('shang',$conn); mysql_query("set names 'utf8'"); $sql = ' select * f 阅读全文

posted @ 2016-12-27 14:49 炊厨 阅读(152) 评论(0) 推荐(0)

查找子孙树

摘要: $arr=[ ['id' => 1, 'cname'=>'电脑','pid'=>0], ['id' => 2, 'cname'=>'手机','pid'=>1], ['id' => 3, 'cname'=>'生活','pid'=>2], ['id'& 阅读全文

posted @ 2016-12-27 14:48 炊厨 阅读(220) 评论(0) 推荐(0)

淘宝ip库接口调用

摘要: function ip($ip) { $url="http://ip.taobao.com/service/getIpInfo.php?ip=".$ip; $ipinfo=json_decode(file_get_contents($url)); if($ipinfo->code=='1'){ re 阅读全文

posted @ 2016-12-27 14:45 炊厨 阅读(426) 评论(0) 推荐(0)

微信接口access_token

摘要: //调用聚合网笑话接口 $url = 'http://japi.juhe.cn/joke/img/text.from?page=&pagesize=2&key=f0d06a1fe45b2d35825810b6b83bdd2d'; $con=https_request($url); p( $con ) 阅读全文

posted @ 2016-12-27 14:42 炊厨 阅读(189) 评论(0) 推荐(0)

curl的POST与GET方法

摘要: $url = '127.0.0.1/shang/bb.php'; $data = array('name'=>'赵猛','age'=>'23'); print_r(get($url,$data)) ; function post($url,$data = array()){ $query = mak 阅读全文

posted @ 2016-12-27 14:36 炊厨 阅读(582) 评论(0) 推荐(0)

HTTP POST GET详解

摘要: get /shang/a1.php http/1.1 host: localhost POST /shang/a1.php HTTP/1.1 Host: localhost Content-Type: application/x-www-form-urlencoded Content-Length: 阅读全文

posted @ 2016-12-27 14:35 炊厨 阅读(128) 评论(0) 推荐(0)

导航