选取出来不同的数据

dreamtd1988 2010-03-11 10:39:16
<%rs.open "<%rs.open "select DISTINCT user_id from starview ",conn,1,1 ",conn,1,1
hang=int(rs.recordcount/5)
if rs.recordcount mod 5>0 then hang=hang+1
if hang<3 then hang=3
for i=1 to hang%>
<tr>
<%for j=1 to 5
if not rs.eof then
rs2.open "select top 1 * from pic where is_star and user_id="&rs("user_id"),conn,1,1
if rs2("pic_width")>rs2("pic_height") then
style="width=171"
else
style="height=171"
end if%>
数据库是access 才能实现红色语句选出不同的id
...全文
49 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
dreamtd1988 2010-03-11
  • 打赏
  • 举报
回复
40分送你了 语句是没错的 是我在后面调用了一个前面未赋值的参数。
dreamtd1988 2010-03-11
  • 打赏
  • 举报
回复
补充下<%rs.open "select DISTINCT user_id from starview ",conn,1,1
hang=int(rs.recordcount/5)
if rs.recordcount mod 5>0 then hang=hang+1
if hang <3 then hang=3
for i=1 to hang%>
<tr>
<%for j=1 to 5
if not rs.eof then
rs2.open "select top 1 * from pic where is_star and user_id="&rs("user_id"),conn,1,1
if rs2("pic_width")>rs2("pic_height") then
style="width=171"
else
style="height=171"
end if%>
应该是这样的 这个问题已经被我学哥解决了 感谢楼上 看了几眼
shan1119 2010-03-11
  • 打赏
  • 举报
回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧