日期:2014-05-17  浏览次数:20884 次

把得到的数据放入数组在从数组中取得数据的问题
<%
sql= "select   top   5   title,content   from   news   where   order   ID   desc "
Set   rs=   Server.CreateObject( "ADODB.Recordset ")                              
rs.open   sql,conn,1,1
%>
<script   language   =   "JavaScript ">
  pic   =   new   Array();
<%
count   =   0
do   while   not   rs.eof
%>
pic[ <%=count%> ]   =   new   Array( " <%=rs( "title ")%> ");

<%
count   =   count   +   1
rspic.movenext
loop
rspic.close
%>
</script>

我在从数组中取得这个5个值   我直接写pic[0],pic[01],pic[2],pic[3],pic[4]


不知道上面这么写对不,望高手指点一下,

------解决方案--------------------
pic[ <%=count%> ] = " <%=Replace(rs( "title "), " " " ", "\ " " ")%> ";