摘要: 无标题文档 外单位 本单位 实际应用中的方法function switchItem(tag,num,j){ var s1 = document.getElementById('tabs'+num+j); var s2 = document.getElementById('tabs... 阅读全文
posted @ 2014-09-19 10:59 longailili 阅读(2784) 评论(0) 推荐(0) 编辑
摘要: function showDiv(objID){ //将时间转化为时间戳 var str = '2009/1/1'; var ftime = str.replace(/-/g,'/'); var uftime = Date.parse(ftime)/100... 阅读全文
posted @ 2014-09-19 10:56 longailili 阅读(243) 评论(0) 推荐(0) 编辑
摘要: $array =array ( 'id' =123, 'name' = 'dopost' );echo http_build_query( $array );//得到结果id=123name=dopost 举例子如下: 复制代码 代码如下:$url = "http://www.electricto... 阅读全文
posted @ 2014-09-17 10:58 longailili 阅读(9194) 评论(0) 推荐(0) 编辑
摘要: $str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("//si","",$str); //注释$str=preg_replace("//si","",$str); //过滤DOCTYPE$str=preg_replace(... 阅读全文
posted @ 2014-09-17 10:38 longailili 阅读(148) 评论(0) 推荐(0) 编辑
摘要: PHP代码$str = preg_replace("/()(.*?)()/", '\1\2\3', $str);其中用了三个子模式(每个圆括号中内容为一个子模式),第一个是链接开始标签,第二个是链接文本,第三个是然后第二个参数中\1、\2、\3就表示这三个部分,要替换成什么样子还不简单?获取页面中的... 阅读全文
posted @ 2014-09-17 10:37 longailili 阅读(183) 评论(0) 推荐(0) 编辑
摘要: $criteria = new CDbCriteria; $criteria->addCondition("MACID=464"); //查询条件,即where id = 1 $criteria->addInCondition('id', array(1,2,3,4,5)); //代表where id IN (1,23,,4,5,); $criteria->addNotInCondition('id', array(1,2,3,4,5));//与上面正好相法,是NOT IN ... 阅读全文
posted @ 2013-12-02 16:21 longailili 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 表的创建 CREATE TABLE `lee` (`id` int(10) NOT NULL AUTO_INCREMENT, `name` char(20) DEFAULT NULL, `birthday` datetime DEFAULT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 数据插入: insert into lee(name,birthday) values ('sam','1990-01-01'); insert into lee(name,birthday) value 阅读全文
posted @ 2013-11-29 14:41 longailili 阅读(338) 评论(0) 推荐(0) 编辑
摘要: 语句一:select count(*) from A where A.a not in (select a from B)语句二:select count(*) from A left join B on A.a = B.a where B.a is null语句三:select count(*) from A where not exists (select a from B where A.a = B.a)知道以上三条语句的实际效果是相同的已经很久了,但是一直没有深究其间的效率对比。一直感觉上语句二是最快的。 今天工作上因为要对一个数千万行数据的库进行数据清除,需要删掉两千多万行数据。大量 阅读全文
posted @ 2013-11-29 14:36 longailili 阅读(620) 评论(0) 推荐(0) 编辑
摘要: select * from test where id in(3,1,5) order by find_in_set(id,'3,1,5'); select * from test where id in(3,1,5) order by substring_index('3,1,2',id,1); 偶尔看到的。。。或许有人会注意过,但我以前真不知道 SQL: select * from table where id IN (3,6,9,1,2,5,8,7);这样的情况取出来后,其实,id还是按1,2,3,4,5,6,7,8,9,排序的,但如果我们真要按IN里面的 阅读全文
posted @ 2013-11-29 14:32 longailili 阅读(311) 评论(0) 推荐(0) 编辑
摘要: /*** 细说YII验证器* @author insun* http://yxmhero1989.blog.163.com**/在yii-1.1.10.r3566版本中,yii自带的验证器共有 19 个。全部如下:// CValidator.php public static $builtInValidators=array( 'required'=>'CRequiredValidator', // 验证属性值必需有值,不能为空 'filter'=>'CFilterValidator', // 用过滤器转换属性... 阅读全文
posted @ 2013-09-10 16:34 longailili 阅读(1935) 评论(0) 推荐(0) 编辑