取用","分隔的字段数据,并查询在另外表是否有,有就显示。
时间:2011-08-12
来源:互联网
a表中有一字段里包含:a,b,c,d等等内容,先取出各自,去除逗号,如:a b c d,然后分别查询另一张b表中是否存在该数据,如果存在则显示内容;且a b c d是独立的字段内容。
我的设想是这样:
第一,取出字段的数据,并得到取出数据的个数
第二,根据取出的个数,说明后面循环查询的次数,如果存在匹配的则显示b表的对应行数据。
不知如何做?
我的设想是这样:
第一,取出字段的数据,并得到取出数据的个数
第二,根据取出的个数,说明后面循环查询的次数,如果存在匹配的则显示b表的对应行数据。
不知如何做?
作者: climix 发布时间: 2011-08-12
各位大侠,有谁能够告诉我?
作者: climix 发布时间: 2011-08-13
代码如下:
shou_xiangmu1=split(shou_xiangmu, ",")
for i=0 to ubound(shou_xiangmu1)
shou=shou_xiangmu1(i)
response.write shou
Set rec= Server.CreateObject ("ADODB.RecordSet")
sqlstr = "select * from wy_shou where shou_min='"&shou&"' "
rec.open sqlstr, conn,1,3
if rec.bof or rec.eof then
response.write"<div align=center><font color=red>收费配置中没有改内容!</font></div>"
response.end
end if
response.write “123”
next
执行到response.write shou没有问题,正常。
错在执行if rec.bof or rec.eof then
response.write"<div align=center><font color=red>收费配置中没有改内容!</font></div>"
response.end
end if
显示“收费配置中没有改内容!”,那么,
sqlstr = "select * from wy_shou where shou_min='"&shou&"' "
肯定有问题,shou参数没有传递到!
请问如何传递
shou_xiangmu1=split(shou_xiangmu, ",")
for i=0 to ubound(shou_xiangmu1)
shou=shou_xiangmu1(i)
response.write shou
Set rec= Server.CreateObject ("ADODB.RecordSet")
sqlstr = "select * from wy_shou where shou_min='"&shou&"' "
rec.open sqlstr, conn,1,3
if rec.bof or rec.eof then
response.write"<div align=center><font color=red>收费配置中没有改内容!</font></div>"
response.end
end if
response.write “123”
next
执行到response.write shou没有问题,正常。
错在执行if rec.bof or rec.eof then
response.write"<div align=center><font color=red>收费配置中没有改内容!</font></div>"
response.end
end if
显示“收费配置中没有改内容!”,那么,
sqlstr = "select * from wy_shou where shou_min='"&shou&"' "
肯定有问题,shou参数没有传递到!
请问如何传递
作者: climix 发布时间: 2011-08-13
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28