
February 25th, 2006, 09:39 AM
|
 |
Contributing User
|
|
Join Date: Sep 2005
Posts: 302
Time spent in forums: 3 Days 15 h 9 m 4 sec
Reputation Power: 4
|
|
|
Displaying all or last 30 comments
I am trying to create two links in ASP, one will display all the comments and the other will display on last 30 days comments, here is what I have done, can anyone please tell me what i am doing wrong.
Code:
<% IF history = 1 THEN %>
<a id="parfont" href="topAccountsDetail.asp?cwmgroupkey=<%=replace(CWMGroupKey,"&","ampersand")%>&pc=<%=request.querystring("pc")%>&page=<%=back_page%>&hist=0&list=<%=request.querystring("list")%>&sort=<%=request.querystring("sort")%>">Hide History</a>
<% ELSE %>
<a id="parfont" href="topAccountsDetail.asp?cwmgroupkey=<%=replace(CWMGroupKey,"&","ampersand")%>&pc=<%=request.querystring("pc")%>&page=<%=back_page%>&hist=1&list=<%=request.querystring("list")%>&sort=<%=request.querystring("sort")%>">View All History</a>
<a id="parfont" href="topAccountsDetail.asp?cwmgroupkey=<%=replace(CWMGroupKey,"&","ampersand")%>&pc=<%=request.querystring("pc")%>&page=<%=back_page%>&hist=1&list=<%=request.querystring("list")%>&sort=<%=request.querystring("sort")%>">View All History</a>
<% End IF%>
<table align="left" BORDER=1 id="parfont" cellspacing="0" cellpadding="0">
<tr><td colspan=4 align="center"><strong><h5>Comments</h5></strong></td></tr>
<%
IF history = 1 THEN
SQL = "select [date], comment, userID, firstname, lastname from top2000_details_comments" & _
" where top2000_details_comments.cwmgroupkey = '" & CWMGroupKey & "' and ProfileClass = '" & request.Querystring("pc") & "' order by [date] asc"
set RS = server.createobject("ADODB.Recordset")
RS.open SQL, CMS, 2, 2
'essentially, this checks if there are records in the table. if so, it draws the table header
if not rs.eof then
%>
|