摘要: yum安装mysql5.5后不能启动 查看日志后解决 my.cnf 加default-storage-engine=MYISAM缓存失效-缓存过期时间分散开缓存并发-需要更新缓存时加锁 阅读全文
posted @ 2014-08-05 09:57 itice 阅读(117) 评论(0) 推荐(0)
摘要: 1、尽量为用来搜索、分类或分组的数据列编制索引,不要为作为输出显示的数据列编制索引。2、综合考虑各数据列的维度势。3、对短小的值进行索引。4、为字符串值得前缀编索引。5、充分利用最左边前缀。6、适可而止,不要建立过多的索引。7、让索引的类型与你打算进行的比较操作的类型保持匹配。8、利用慢查询日志找出性能低劣的查询。 阅读全文
posted @ 2014-02-13 13:50 itice 阅读(232) 评论(0) 推荐(0)
摘要: 版本兼容:if(version_compare(PHP_VERSION,'5.2.0',' 5.2.0 !');5.3.0以下版本set_magic_quotes_runtime(0);使用addslashes环境兼容:都转为/以兼容目录权限目录名大小写路径连接符其他:统计内存使用需要 MEMORY_LIMIT_ON 常量为true时区设置 阅读全文
posted @ 2013-11-15 14:49 itice 阅读(169) 评论(0) 推荐(0)
摘要: 1 //获取指定日期所在星期的开始时间与结束时间 2 function getWeekRange($date){ 3 $ret=array(); 4 $timestamp=strtotime($date); 5 $w=strftime(‘%u’,$timestamp); 6 $ret['sdate']=date(‘Y-m-d 00:00:00′,$timestamp-($w-1)*86400); 7 $ret['edate']=date(‘Y-m-d 23:59:59′,$timestamp+(7-$w)*86400); 8 return $ret; 9 }10 阅读全文
posted @ 2013-11-15 14:47 itice 阅读(491) 评论(0) 推荐(0)
摘要: 1 //验证码 2 function _code($_width = 75, $_height = 25) { 3 //随机字符 4 for ($i = 0; $i < 4; $i++) { 5 $_num .= dechex(mt_rand(0, 15)); 6 } 7 8 $_SESSION['code'] = $_num; 9 //创建图像10 $im = imagecreatetruecolor($_width, $_height);11 12 //填充背景色13 $bg_color = imagecolorallocate($im, 250, 250, 阅读全文
posted @ 2013-11-15 14:42 itice 阅读(294) 评论(0) 推荐(0)
摘要: 1、使用setcookie必须在标签之前2、使用setcookie之前,不可以使用echo输入内容3、直到网页被加载完后,cookie才会出现4、setcookie必须放到任何资料输出浏览器前,才送出特别注意:如果使用utf-8编码,一定要去掉UTF-8中的BOM,这都是因为utf-8编码文件含有的bom原因,而php4,5都是不支持bom的。去掉bom,可以用Notepad++打开转换一下。 阅读全文
posted @ 2013-11-15 14:37 itice 阅读(624) 评论(0) 推荐(0)
摘要: 1 ignore_user_abort(true);2 set_time_limit(0);3 4 sleep(5); 阅读全文
posted @ 2013-11-15 14:36 itice 阅读(143) 评论(0) 推荐(0)