<% set rs1=server.CreateObject("adodb.recordset") rs1.open "select * from city order by id desc",conn,1,1 %> <%set rs2=server.CreateObject("adodb.recordset") rs2.open "select * from weather where cityid='"&rs1("id")&"'",conn,1,1
%> 我是调用了两个表,weather表中的cityid是和city表中的id想对应的.可是我在查询输出时却调不出数据.没有错误提示,是不是cityid='"&rs1("id")&"'",这里用的不对啊?请指点!~
不
<% set rs1=server.CreateObject("adodb.recordset") rs1.open "select * from city order by id desc",conn,1,1 %> 这里加入对rs1的id读取操作,否则万一rs1是eof怎么办 <%set rs2=server.CreateObject("adodb.recordset") rs2.open "select * from weather where cityid='"&rs1("id")&"'",conn,1,1
%>