wnguh

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2012年6月18日

摘要: 今天在学习maatkit的mk-query-digest这个强大的工具,它能分析慢查询日志,也可以对当前的语句进行分析。所以要启用MySQL的log-slow-queries(慢查询记录)。 在Linux环境下先要找到my.cnf文件(一般在/etc/mysql/),然后可能会发现该文件修改后无法保存,原因是你没有相应的权限,可以从属性中看到该文件的所有者是root,这时要先以root的身份打开它: sudo nautilus /etc/mysql 接着再打开my.cnf文件然后找到[mysqld]标签在下面加上: log-slow-queries=/path/slow.log –慢日志保存. 阅读全文
posted @ 2012-06-18 16:08 wnguh 阅读(4045) 评论(0) 推荐(0)

2012年2月3日

摘要: convert( smallbooking, signed )转整形 阅读全文
posted @ 2012-02-03 13:32 wnguh 阅读(218) 评论(0) 推荐(0)

2011年12月7日

摘要: 需要修改两个文件 /etc/hosts 和/etc/sysconfig/network 第一步:修改/etc/hosts 命令# vi /etc/hosts 127.0.0.1 www.ccc5188.com wq(保存) 第二步:修改 /etc/sysconfig/network 命令如下:# vi /etc/sysconfig/network networking=yes hostname=www.ccc5188.com wq(保存) 阅读全文
posted @ 2011-12-07 12:37 wnguh 阅读(264) 评论(0) 推荐(0)

2011年11月24日

摘要: 1、将时间转换为时间戳select unix_timestamp('2009-10-26 10-06-07')如果参数为空,则处理为当前时间2、将时间戳转换为时间select from_unixtime(1256540102)有些应用生成的时间戳是比这个多出三位,是毫秒表示,如果要转换,需要先将最后三位去掉,否则返回NULLselect date_format(日期字段,’%Y-%m-%d’) as ‘日期’ from test 阅读全文
posted @ 2011-11-24 17:12 wnguh 阅读(20056) 评论(0) 推荐(3)

2011年11月21日

摘要: select name from order where oderid in(111,222,333,444,555,666) order by instr('111,222,333,444,555,666',orderid) 阅读全文
posted @ 2011-11-21 16:20 wnguh 阅读(200) 评论(0) 推荐(1)

2011年11月17日

摘要: Smarty中的分页有很多方法。1。使用Smarty的分页插件,如Pager,pagnition,sliding_page等,不过感觉都不是太好,几乎都有一些Bug。有兴趣试用和自己去改进的朋友可以看看:http://smarty.php.net/contribs/plugins/view.php/function.pager.phphttp://www.phpinsider.com/smarty-forum/viewtopic.php?t=2327http://www.phpinsider.com/smarty-forum/viewtopic.php?t=16042。使用分页类库,呵呵,这个 阅读全文
posted @ 2011-11-17 12:02 wnguh 阅读(2432) 评论(0) 推荐(0)

2011年11月4日

摘要: 二、拆分成2段字段内容aaa,bbbSELECT title, logopath, link, LEFT( info, (INSTR( info, ',' ) -1 )) AS info1, SUBSTRING( info, (INSTR( info, ',' ) +1 )) AS info2 FROM site_photo_info WHERE Pclass = '991' order by addtime desc二、拆分成3段字段内容aaa,bbb,cccSELECT title, logopath, link,LEFT( info, (I 阅读全文
posted @ 2011-11-04 15:50 wnguh 阅读(807) 评论(0) 推荐(0)

摘要: {section name="sn" loop="$BusinesList4"} <li><a href="#"><span>{$smarty.section.sn.index+1}</span>{$BusinesList4[sn].2}</a></li> {/section}可以看出,无论是索引还是关联数组用起来都是很方便。下面介绍下section中各个属性的说明:1、section中的属性name:(必选) 是section循环的名称只是标示循环唯一的名字没有 阅读全文
posted @ 2011-11-04 13:51 wnguh 阅读(5396) 评论(1) 推荐(1)

摘要: Smarty 中的 if 语句和 php 中的 if 语句一样灵活易用,并增加了几个特性以适宜模板引擎. if 必须于 /if 成对出现. 可以使用 else 和 elseif 子句. 可以使用以下条件修饰词:eq、ne、neq、gt、lt、lte、le、gte、ge、is even、is odd、is not even、is not odd、not、mod、div by、even by、odd by、==、!=、>、<、<=、>=. 使用这些修饰词时必须和变量或常量用空格格开.eq相等,ne、neq不相等,gt大于,lt小于,gte、ge大于等于,lte、le 小于等 阅读全文
posted @ 2011-11-04 11:26 wnguh 阅读(2307) 评论(0) 推荐(0)

2011年11月3日

摘要: capitalize [首字母大写] count_characters [计算字符数] cat [连接字符串] count_paragraphs [计算段落数]count_sentences [计算句数]count_words [计算词数]date_format [时间格式]default [默认]escape [转码]indent[缩进]lower[小写 ]nl2br[换行符替换成<br />]regex_replace[正则替换]replace[替换]spacify[插空]string_format[字符串格式化]strip[去除(多余空格)]strip_tags[去除html 阅读全文
posted @ 2011-11-03 15:36 wnguh 阅读(566) 评论(0) 推荐(0)