变量有多个逗号隔开如何逐个提取
数据库表Resultid remark
1 a, b, c, 1, 2, 3
. .
. .
30 123, 我, n, ,b, 9
查询显示remark并且每行逐个,如:
a
b
c
1
2
3
代码如下:
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>123</title>
<link href="images/index.css" rel="stylesheet" type="text/css">
</head>
<body>
<%
dim str
dim strs()
dim tempstr
set rs=server.createobject("adodb.recordset")
sql="select * from Result where id =30 "
rs.open sql,conn,1,1
do while not rs.eof
%>
<%
rs.movenext
loop
rs.close
set rs=nothing
%>
<%
str=rs("remark")
strs=split(str,",")
for i=0 to strs
response.write strs(i)
next
%>
</body>
</html>
求指点,谢谢!