28,409
社区成员




dim sql,rs, str
str=""
sql="select distinct hotel_id from 你的表名" 'distinct 不一定要加,“你的表名”你自行修改一下
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.bof and rs.eof then
response.Write("无数据") '没有数据
else
do while not rs.eof
str=str+rs(1) & "|" '这个|可以换成其他的
rs.movenext
loop
end if
rs.close
set rs=nothing
response.write str '这就是你要的数据,然后怎么提交你看着办吧......
'最终得到的结果如:100|101|102|103|
'如果要再分开取100、101、102、103,使用split吧
'函数名:CheckStrInArray
'作 用:判断字符串是否存在数组中
'参 数:str 传递的字符串 array 数组
'返回值:存在 true 不存在 false
function CheckStrInArray(str,arr)
CheckStrInArray=false
if not isnull(arr) and isarray(arr) then
for ii=0 to ubound(arr)
if trim(arr(ii))=trim(str) then
CheckStrInArray=true
exit function
end if
next
end if
end function