10 2020 档案
摘要:select * from student s where s.stuName in(“张三”,“李四”,“王五”)and s.age>18 and s.sex=‘男’; 优化后的sql: select * from student s where s.stuName=“张三” and s.age>
阅读全文
摘要:什么是自动加载 自动加载就是当我们在当前文件中实例化一个不存在的类时,调用自动加载机制引入相应的类文件。 注:自动加载有两种方式(都是php内置的),一种是通过__autoload(),另一种是通过spl_autoload_register()。 二、通过__autoload() 实现自动加载 /d
阅读全文
摘要:drop table 1)属于DDL2)不可回滚3)不可带where4)表内容和结构删除5)删除速度快 truncate table 1)属于DDL2)不可回滚3)不可带where4)表内容删除5)删除速度快 delete from 1)属于DML2)可回滚3)可带where4)表结构在,表内容要看
阅读全文
摘要:获取当前时间戳 select unix_timestamp(); 同 select unix_timestamp(now()); 获当前时间 select now(); 时间转时间戳 select unix_timestamp('2018-01-15 09:45:16'); 时间戳转时间 selec
阅读全文
摘要:查看日志 前 n行: 1、 cat 文件名 | head -n 数量 demo cat test.log | head -n 100 # 查看test.log前100行 查看日志 尾 n行: 2、 cat 文件名 | tail -n 数量 demo cat test.log |tail -n 100
阅读全文
摘要:原理:其实就是把$a转换成了数组 比如你直接打印$a[1]的结果是2 如果你打印$a[0]就是1 相当于把字符串转换成了数组! public function ceshi(){ $a = '1234567890'; $i = 0; $b = ''; while (isset($a[$i]) && $
阅读全文