Page Reordering

Discussion in 'HTML & Website Design' started by Arcos, Oct 11, 2006.

  1. #1
    I am trying to find a way of reordering the contents of a page.

    Currently showing alphabetically A-Z 1-9 want to change it to show by date with newest first i.e 11th October comes at the top of the list above 10th Ocbober etc etc.

    A a newbie to .asp I am not sure if the code to do it is in this.........

    <!-- #include file = "adovbs.inc" -->

    <%
    set rs=server.CreateObject ("Adodb.recordset")
    rs.Open "select * from faq order by heading",con,1,3

    if rs.RecordCount=0 then
    %>
    <table width=100% class="bodyTxt">
    <tr>
    <td height="20" align="justify"><span class="homeTitle"><img src="images/bullet.gif" width="9" height="6">&nbsp;FAQ</span></td>
    </tr>
    <tr>
    <td height="1" background="images/adventure_33.jpg"></td>
    </tr>
    <tr>
    <td align=center><span class="homeTitle">Contents not updated yet!!</strong></td>
    </tr>
    </table>
    <% else
    count=1
    %>
    <table width="100%" border="0" align="center" cellpadding="1" cellspacing="0" class="bodyTxt">
    <tr>
    <td height="20" align="justify"><span class="homeTitle"><img src="images/bullet.gif" width="9" height="6">&nbsp;FAQ</span></td>
    </tr>
    <tr>
    <td height="1" background="images/adventure_33.jpg"></td>
    </tr>
    <% do while not rs.eof %>
    <tr>
    <td width="64%" class="bodyTxt" height="20" align="justify"><img src="images/arrow.jpg" width="19" height="16">&nbsp;<span class="homeTitle"><%=rs(1)%></stong></td>
    </tr>
    <tr>
    <td height="1"></td>
    </tr>
    <tr>
    <td class="bodyTxt"> <%=rs(2)%></td>
    </tr>
    <tr><td height=10></td></tr>
    <tr>
    <td height="1" background="images/adventure_33.jpg"></td>
    </tr>
    <tr><td height=5></td></tr>
    <% if count mod 3 =0 then %>
    <tr>
    <td>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    </table>
    </td>
    </tr>
    <% end if %>
    <%count=count+1
    rs.movenext
    loop
    %>
    </td>
    <tr>
    <td><div align="right"><a href="#" target="_top" class="top">[ ^ ] Top </a></div></td>
    </tr>
    </tr>
    </table>
    <%
    end if
    rs.close
    %>
     
    Arcos, Oct 11, 2006 IP