摘要: 对于多处使用case when 来判断的SQL语句会觉得整个语句很繁琐。对于MSSQL可以提供给用户自定义函数。虽然比较少用。实例:将查询的字段进行非空处理。分析:数据通过外表汇总过来,null值可以通过默认过滤掉,但对于外表是' '字段无法设置默认值。drop function exchangegocreate function exchange(@input char(30))returns char(30)as begin declare @return_input char(30) if rtrim(@input)='' or @input is nul 阅读全文
posted @ 2010-09-20 09:49 Tomi-Eric's 阅读(945) 评论(0) 推荐(0) 编辑
摘要: 实例:有A,B,C,D四个输入框,但只要求只填一个。 可以随意选择一个填写。完整例子:[代码] 阅读全文
posted @ 2010-09-19 15:32 Tomi-Eric's 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 借助于Mr.Think写的利用url实现菜单高亮。判断当前url(window.location.href)与页面中的a标签的href属性值是否相等。如果相等则显示高亮。代码 阅读全文
posted @ 2010-08-24 10:00 Tomi-Eric's 阅读(227) 评论(0) 推荐(0) 编辑
摘要: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->本机IP:127.0.0.1,测试成功!为了项目测试和开发效果,我们往往让自己的机子虚拟化。比如浏览本机的http://127.0.0.1/转换为自己网站的域名。这对开发过程有很好的作用,也减少网站部署后测试的时间。环境:winXP,Apache将C:\WINDOWS\system32\drivers\etc目录下的Hosts文件修改。127.0.0.1 localhost10.0.0.2... 阅读全文
posted @ 2010-08-20 10:31 Tomi-Eric's 阅读(313) 评论(0) 推荐(0) 编辑
摘要: <?php #basename(path[,suffix]) 返回路径的文件名部分 $path="/thinkphp/Examples/readme.txt"; echo "<p>".basename($path)."</p>"; #dirname()获得路径目录 echo "<p>".dirname($path)."</p>"; #pathinfo()由目录,基本名和扩展名组成 $pathinfo=pathinfo($path); echo 阅读全文
posted @ 2010-08-17 14:40 Tomi-Eric's 阅读(404) 评论(0) 推荐(0) 编辑
摘要: <?php $username="ginoSin"; #判断参数是否只在a-z范围 if(ereg("([^a-z])",$username)) { echo "username must be all lowercase"; } else { echo "username is all lowercase"; } echo "<br>"; #输出字符参数的长度 echo "the length of $username is:".strlen($usern 阅读全文
posted @ 2010-08-16 15:44 Tomi-Eric's 阅读(169) 评论(0) 推荐(0) 编辑
摘要: php函数有很多,需要时查询api。<?php /* #数组 没有限制大小:$arr[0]=1;$arr[1]=2; $arr=array("0","1");$list($num1,$num2)=$arr; array range(int low,int high[,int step]) low最小数,high最高数,step步长 int array_unshift(array array,mixed vari) 数组前面插入 array_push 数组尾添加 array_shift 数组头部删除 array_pop 数组尾部删除 #定位数组 .. 阅读全文
posted @ 2010-08-14 12:02 Tomi-Eric's 阅读(286) 评论(0) 推荐(0) 编辑
摘要: 第一章 PHP基础Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php/**#打印函数 echo,print,printf,sprintf#基本类型 boolean,integer,float,string,object(array、对象)#强制类型转换#gettype()返回var指定变量类型:array,boolean,double,integer,object,resource,string,unknow typestrin 阅读全文
posted @ 2010-08-13 17:14 Tomi-Eric's 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 看到漂亮的搜索框,收藏...主要用背景图片和输入框和链接隐藏完成。可以在IE6+,ff,chorme下兼容...<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv=" 阅读全文
posted @ 2010-07-30 14:25 Tomi-Eric's 阅读(1146) 评论(1) 推荐(0) 编辑
摘要: 伪类浏览器支持:IE Internet Explorer, F: Firefox, N: Netscape。W3C:“W3C” 列的数字显示出伪类属性由哪个 CSS 标准定义(CSS1 还是 CSS2)。伪类作用IEFNW3C:active将样式添加到被激活的元素4181:focus将样式添加到被选中的元素---2:hover当鼠标悬浮在元素上方时,向元素添加样式4171:link将特殊的样式添加到未被访问过的链接3141:visited将特殊的样式添加到被访问过的链接3141:first-child将特殊的样式添加到元素的第一个子元素172:lang允许创作者来定义指定的元素中使用的语言18 阅读全文
posted @ 2010-07-23 17:07 Tomi-Eric's 阅读(224) 评论(0) 推荐(0) 编辑