goodfaith727的博客
goodfaith727 · 共 2 篇文章
多字段模糊查询
quote: create table orders ( id int not null auto_increment, name varchar(100) not null, email varchar(255) not null, address text not null, pay_type char(10) not null, shipped_at datetime null, primary key (id)); 首先,将要匹配相同条件的字段连起来(field1+field2+...)成一个长字符串;然后再 Like “%cond%”就可以了。一般来说,单表内字段连接后再统一lik…
2011-05-24 18:00 · 评论(0)
JS判断不能全部输入空格 和 去掉所有空格
//不能全部输入空格 //这是正则,\s匹配空格和回车等 var parten = /^\s*$/ ; //执行验证 if(parten.test(var1)) alert( "all spaces! ") ; else alert( "not all spaces "); } ** 去除所有空格: str = str.replace(/\s+/g,""); 去除两头空格: str = str.replace(/^\s+|\s+$/g,"");**
2011-05-18 17:15 · 评论(0)