asp classic - Database content not displaying when paging in ASP -
i've been working on site using classis asp while (on own personal server) i've hit stumbling block. i'm trying paging work reason nothing shows on pages, cannot fathom @ all. site advertisement board, on 1 page shows total of each item type, click on , shows items pages them.
<% if (request.querystring("type") <> "" ) set rs = server.createobject("adodb.recordset") rs.open "select s.unique_id, s.location,s.extension,s.item,s.description,s.price,s.date_on_sale,s.type, s.name, s.date_posted " & _ " tblsales s lower(s.type) = lower('" & request.querystring("type") & "')" , objconn, 3, 3 if (rs.bof or rs.eof) strmsg = "<font color='red'> <b> system found no results <u> " & request.querystring("type") & " </u> </b></font>" end if %> <%response.write(strquery) %> <div id="midrow" style="clear:both;"> <div class="center"> <p>to view details of item, click on desired item</p> </div> </div> <div class="board_bottomrow"> <div class="center"> <% if strmsg <> "" response.write(strmsg) else dim bshowpages rs.pagesize = 20 npagecount = rs.pagecount if npagecount <2 bshowpages = false else bshowpages = true end if npage = clng(request.querystring("page")) if (request.querystring("page") = "") npage = 1 if npage < 1 or npage > npagecount npage = 1 end if item_type = request.querystring("type") rs.absolutepage = npage %> <div> <b> <%= request.querystring("type") %> items </b> </div> <br> <table class="table_border" cellpadding="5" cellspacing="5" border="0" style="width:950px" id="items" > <thead> <th style="text-align:left"> <b> <font size="2"> item </font> </b> </th> <th style="text-align:left"> <b> <font size="2"> description </font> </b> </th> <th style="text-align:left;"> <b> <font size="2"> price </font> </b> </th> <th style="text-align:left;"> <b> <font size="2"> posted </font> </b> </th> <th style="text-align:left;"> <b> <font size="2"> extension </font> </b> </th> <th style="text-align:left;"> <b> <font size="2"> posted on </font> </b> </th> </thead> <tbody> <% response.write(rs.absolutepage) while not (rs.eof or rs.absolutepage <> npage) %> <tr style="vertical-align:top"> <td> <a href='board_item.asp?link_id=<%=rs("unique_id")%>'> <%= rs("item") %> </a> </td> <td style="width:350px"> <%= rs("description") %> </td> <td style="margin-left:10px"> £ <%= rs("price") %> </td> <td> <%= rs("name") %> </td> <td> <%= rs("extension") %> </td> <td> <%= rs("date_posted") %> </td> </tr> <% rs.movenext() wend 'response.write ("bshowpages " & bshowpages) %> <!-- show pages if pagecount > 1 --> <%if bshowpages <> false then%> <tr style="background-color:#f1f1f1"> <td> pages: </td> <td colspan="5"> <a href='items.asp?type=<%=item_type%>&page=1'> first </a> <a href='items.asp?type=<%=item_type%>&page=<%=npage - 1%>'> prev </a> <a href='items.asp?type=<%=item_type%>&page=<%=npage + 1%>'> next </a> <a href='items.asp?type=<%=item_type%>&page=<%=npagecount%>'> last </a> <td> </td> </tr> </tbody> </table> <%end if%> <% end if %> </div> <br> im pretty aware there bad coding in sample, it's personal learning project me @ moment, if can see why records wouldn't displaying id greatful. pagenumbers show up, non of records. thanks.
Comments
Post a Comment