目的,想通过上一页传过来的变量str=a 来查询出上述这个字段。
小弟已试过,
select * from a where nr like '%"request("str")"%' 或
select * from a where '%"request("str")"%' like nr 都不行,请高手指教,
另外,我通split函数可以把上述记录查询到,但我还有一个分页,要搞,用了split函数,分页就不行了。请高手指点一点,小弟感激不尽~~~
select * from a where nr like '%"request("str")"%'
应该是错了吧!应该是这样的吧:
select * from a where nr like '%"&request("str")&"%'
select * from a where nr like '%"&request("str")&"%'
select * from a where nr in('"&request("str")&"')
一般查询语句出现异常 第一步你先把拼合的SQL语句输出看看是否有问题,能不能在查询分析器获得正确的结果。
asp中
sql="select * from a where nr like '%"&request("str")&"'"
先response.write sql
然后查询分析器执行上面的sql
| 论坛热门帖子: | [lch203] 写得蛮好的linux学习笔记(10-21) [黑马制造] 学习java的30个目标(10-19) [笑傲股林] 做测试半年了,有点迷茫,应该再学些什么提高自己的测试水平和测试能力呢?(10-19) [udp8589] 大家用google的来吱一声? 用百度的~~也来报道下?(10-18) [沂偌掳兆] 本人总结的一些认为C++比较经典的书籍,希望对大家有用(10-18) |
| TAG标签: | 问题 查询 记录 str nr where from select like %request |
注册
个人空间
