05 2019 档案
strtotime
摘要:echo date("Y-m-d",strtotime("-1 month",strtotime("2019-7-31"))); //2017-07-01 //为什么输出不是6.31呢,因为6月没有31,-1 month变成6.31后其实是7.1号。 echo date("Y-m-d",strtotime("last day of -1 month",strtotime("2019-7-31"... 阅读全文
posted @ 2019-05-07 14:21 泪滴 阅读(1022) 评论(0) 推荐(0)
mysql的锁原理
摘要:myisam: 只有表锁,分为表共享读锁,表排他写锁。不支持事务 表共享读锁:session1:lock table a read ; 此session1能对只能对a表读,其他都干不了,其他的session能对这个表读。直到unlock tables; 表排他锁:session1:lock table a write; 此session1能对a表进行update,insert,select,de... 阅读全文
posted @ 2019-05-07 11:32 泪滴 阅读(868) 评论(0) 推荐(0)
set autocommit
摘要:set autocommit 1|01 mysql默认为1,表示开启自动提交。0 表示没有开启自动提交如果没有开启自动提交,当前session1所链接的mysql的所有操作都会当成一个事务直到你输入rollback/commit;当前事务才算结束。当前事务结束前新的mysql连接时无法读取到任何se 阅读全文
posted @ 2019-05-06 17:55 泪滴 阅读(2309) 评论(0) 推荐(0)