摘要: Linux下的压缩解压缩命令详解及实例 实例:压缩服务器上当前目录的内容为xxx.zip文件 zip -r xxx.zip ./* 解压zip文件到当前目录 unzip filename.zip 阅读全文
posted @ 2014-06-03 13:48 大自然的流风 阅读(1016167) 评论(1) 推荐(8) 编辑
摘要: php 5.4中php-fpm 的重启、终止操作命令: /etc/init.d/php-fpm restart 查看php-fpm进程数: ps aux | grep -c php-fpm 阅读全文
posted @ 2014-06-03 13:23 大自然的流风 阅读(171133) 评论(0) 推荐(2) 编辑
摘要: php中实现后台执行的方法: ignore_user_abort(true); // 后台运行 set_time_limit(0); // 取消脚本运行时间的超时上限 后台运行的后面还要,set_time_limit(0); 除非在服务器上关闭这个程序,否则下面的代码将永远执行下去止到完成为止。 如果程序运行不超时,在没有执行结束前,程序不会自动结束的. 阅读全文
posted @ 2014-06-03 13:17 大自然的流风 阅读(39011) 评论(0) 推荐(1) 编辑
摘要: MySQL 字符串截取函数:left(), right(), substring(), substring_index()。还有 mid(), substr()。其中,mid(), substr() 等价于 substring() 函数,substring() 的功能非常强大和灵活。#查询某个字段后两位字符 select right(last3, 2) as last2 from historydata limit 10; #从应该字段取后两位字符更新到另外一个字段 update `historydata` set `last2`=right(last3, 2); 阅读全文
posted @ 2014-06-03 03:48 大自然的流风 阅读(466533) 评论(5) 推荐(13) 编辑
摘要: mysql 替换字符串的实现方法: mysql中replace函数直接替换mysql数据库中某字段中的特定字符串,不再需要自己写函数去替换,用起来非常的方便,mysql 替换函数replace() Update `table_name` SET `field_name` = replace (`field_name`,’from_str’,'to_str’) Where `field_name` LIKE ‘%from_str%’ 实例:把'病假' 替换为 '--':UPDATE users SET username=REPLACE(username,'病假','--') WHERE username LIKE '%病假%'; 说明: table_name —— 表的名字 field_name —— 字段名 from_str —— 需要替换的字符串 to_str —— 替换成的字符串 阅读全文
posted @ 2014-06-03 03:44 大自然的流风 阅读(14614) 评论(0) 推荐(0) 编辑