#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Posts
    20
    Rep Power
    0

    "start" parameter


    Hi I need to ask a question about the start parameter. I made a previous post awhile back about it but I am still unclear how to use it. I wanted to diplay 10 records per page, if it exceeded that it it would display it on another page with a link to it. I view the source on the devshed forum that used start parameter:

    href="http://forums.java.sun.com/forum.jsp?forum=45&amp;start=30&amp;range=15"><B>3</B></A>&nbsp;<A
    href="http://forums.java.sun.com/forum.jsp?forum=45&amp;start=45&amp;range=15"><B>4</B></A>&nbsp;<A
    href="http://forums.java.sun.com/forum.jsp?forum=45&amp;start=60&amp;range=15"><B>5</B></A>&nbsp;<A
    href="http://forums.java.sun.com/forum.jsp?forum=45&amp;start=75&amp;range=15"><B>6</B></A>&nbsp;<A
    href="http://forums.java.sun.com/forum.jsp?forum=45&amp;start=90&amp;range=15"><B>7</B></A>

    1. is the above code all I need to accomplish this?
    2. what does forum=45&amp refer to?
    3. would forum.jsp be an blank page(no code) to display the remaining records
    4.I have a page(portion of code)
    while(rs.next())
    {
    String cisy1212=rs.getString("cisy1212");
    String cisy2311=rs.getString("cisy2311");
    String cisy2313=rs.getString("cisy2313");
    String cisy2314=rs.getString("cisy2314");
    String cisy2315=rs.getString("cisy2315");


    %>
    <tr bgcolor="#efefef">
    <td width="8%" height="18"><%= rs.getString("recdate")%></td>
    <td width="10%" height="18"><%= rs.getString("studentid")%>
    <input type="hidden" name="studentid" value="<%= rs.getString("studentid")%>"></td>
    <td width="11%" height="18"><%=rs.getString("firstname")%>
    <%=rs.getString("lastname")%></td>
    <td width="15%" height="18"><a href="mailto:<%=rs.getString("email")%>"><%=rs.getString("email")%></a></td>
    <td width="13%" height="18"> <%
    if((cisy1212!=null) || (cisy2311 !=null) ||(cisy2313!=null) ||(cisy2314!=null) ||(cisy2315!=null))
    %> <%=cisy1212%>,<%=cisy2311%>,<%=cisy2313%>,<%=cisy2314%>,<%=cisy2315%></td>

    <td width="15%" height="18"><%=rs.getString("cisy1212")%>,<%=rs.getString("cisy2311")%>,<%=rs.getString("cisy2313")% >,<%=rs.getString("cisy2314")%>,<%=rs.getString("cisy2315")%></td>
    <td width="6%" height="18"><%=rs.getString("qualified")%></td>
    <td width="6%" height="18"><%=rs.getString("applied")%></td>
    <td width="6%" height="18"><%=rs.getString("accepted")%></td>
    <td width="6%" height="18">
    <input style="BACKGROUND-IMAGE: url(file://C:\jakarta-tomcat-4\webapps\CISY2415\images\trash2.gif); WIDTH: 28px; HEIGHT: 36px; BACKGROUND-COLOR: #efefef" type=submit name=delete size=14 onClick="alert('Do you want to delete the record?')">
    </td>
    </tr>
    <p><a href="file://C:\jakarta-tomcat-4\webapps\newCISY2415\page.jsp?page=45&amp;start=1&amp;range=1">previous</a>

    <a href="file://C:\jakarta-tomcat-4\webapps\newCISY2415\page.jsp?page=45&amp;start=1&amp;range=1">next</a></p>

    <% } //end while()

    would I put the start parameter inside the loop? do I have to use a limit function in mysql statement?

    Thanx

    getchoo
  2. #2
  3. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538
    <A
    href="http://forums.java.sun.com/forum.jsp?forum=45&start=90&range=15"><B>7</B></A>
    is a simple GET request made trough a url forum=45 start=90 range=15 are the parameters passed.
    So IMHO isn't a real start parameter.
    You can set the start and range values dinamically in a loop to build that "prev 1 2 3 4 next" indexes. Probably forum=45 identifies a specific forum.

IMN logo majestic logo threadwatch logo seochat tools logo