asp多条件查询sql语句用法,可用于搜索、筛选模块
分类:程序开发 Tags: asp 评论:0 浏览:2523 最近更新时间:2006/12/2 20:15:18
多条件查询sql语句用法,比较不错的多条件查询asp代码写法,很实用,也很简洁。
- big_id=trim(request("big_id"))
- small_id=trim(request("small_id"))
- key=trim(request("key"))
- yongtu=trim(request("yongtu"))
- chudian=trim(request("chudian"))
- dianliu=trim(request("dianliu"))
- dianya=trim(request("dianya"))
- Set Rs=Server.CreateObject("ADODB.Recordset")
- sql="select * from yuzhiguo_products where 1=1"
- if big_id<>"" then sql=sql&" and big_id="&big_id&""
- if small_id<>"" then sql=sql&" and small_id="&small_id&""
- if yongtu<>"" then sql=sql&" and yongtu="&yongtu&""
- if chudian<>"" then sql=sql&" and chudian="&chudian&""
- if dianliu<>"" then sql=sql&" and dianliu="&dianliu&""
- if dianya<>"" then sql=sql&" and dianya="&dianya&""
- if key<>"" then sql=sql&" and ( e_cpmc like '%"&key&"%') "
- sql=sql&" order by "&paixu&" desc,id desc"
本文地址:/93/
-
• js点击复制代码
• 在文章内容中随机插入网站版权文字,防止采集
• ASP过滤SQL非法字符并格式化html代码,不错的功能函数集
• ASP获取图片宽度和高度的程序源代码
• ASP多个关键词搜索代码,关键词以+号或空格隔开
• js兼容IE、谷歌Chrome、火狐Firefox的上传图片预览代码
• ASP将汉字转为拼音代码
• ASP搜索关键词时结果用红色显示代码
• rs.open sql,conn,1,1和rs.open sql,conn,1,3的意思
• centos系统挂载数据盘方法