代码如下:
<select name="newsclass" id="newsclass">
<% '从newsclass表中读取新闻类别
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
Sql1="Select * From newsclass where class in(1,2) order by id asc"
Rs1.Open Sql1,conn,3,3
Do While not Rs1.EOF
Response.Write "<option value=" & Rs1("class") & ">" & Rs1("title") & "</option>"
Rs1.MoveNext
Loop
Rs1.Close
Set Rs1=nothing
%>
</select>
Set Rs1 = Server.CreateObject("ADODB.RecordSet")
if 用户名字段="user1" then
Sql1="Select * From newsclass where class in(1,2) order by id asc"
elseif 用户名字段="user2" then
Sql1="Select * From newsclass where class in(2,3) order by id asc"
end if
Rs1.Open Sql1,conn,3,3作者: 熾天使rose 时间: 2010-1-10 05:34
用 session 作个关联作者: 单身中 时间: 2010-1-10 05:34
用户表里放个字段,说明一下这个用户属于哪个用户组。
选项表里放个字段,说明一下哪个组可以看到这个选项。