Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Oct 2002
    Location
    Canada (eh)
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Total Records Found - Top & Bottom

    This is my first time asking a question in here so I hope I follow the Posting Guidelines correctly.

    I have a table (as shown below) that will be posting data received from a search form.

    I would like to have the Total Records Found & total showing above and below the actual table itself.

    The bottom (bottomRw) total part works great but the top (topRw) total part is giving me the headache.

    This is a bare-bones representation of the actual table I am using; hopefully, nothing pertinent has been omitted.

    Any feedback or help would be greatly appreciated. I am quite sure it is something simple but you never know til you ask.

    -------------------------------------------------------

    <body onload="OnLoads()">

    <div align="center"><table border="1" cellpadding="3" cellspacing="0" width="50%">

    <tr id="topRw">
    <td width="50%">
    <font type="arial narrow" size="3" color=red>Total Records Found:&nbsp; <%= recNum%>
    </td></tr></table></div><br>

    <div align="center"><table border="0" cellpadding="3" cellspacing="0" width="50%">
    <font type="arial narrow" size="3">

    <tr>
    <td width="50%" style="color: rgb(255,255,0); background-color: rgb(0,128,128)">
    <div align="center"><p><b>TITLE</b></p></div></td></tr>

    <%
    SQLqry.MoveFirst
    Do Until SQLqry.EOF
    recNum = recNum + 1
    %>

    SQL Query results go here

    <%
    SQLqry.MoveNext
    Loop
    %>

    </font></table></div><br>

    <div align="center"><table border="1" cellpadding="3" cellspacing="0" width="50%">

    <tr id="bottomRw">
    <td width="50%">
    <font type="arial narrow" size="3" color=red>Total Records Found:&nbsp;<%= recNum %>
    </td></tr></table></div><br>

    <script>
    function OnLoads()
    {
    document.all.topRw.innerText = document.all.bottomRw.innerText
    }
    </script></body>

  • #2
    Regular Coder
    Join Date
    Jul 2002
    Location
    Raleigh, NC
    Posts
    484
    Thanks
    0
    Thanked 0 Times in 0 Posts
    you connot call the counter number before it has been calculated. You are asking for the total number before you give the calculation of how to get that number. You need tp place the loop before the <%= recNum%>
    -WebMark Art
    Programming is 80% thinking and 20% spelling

  • #3
    New Coder
    Join Date
    Oct 2002
    Location
    Canada (eh)
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Point Taken

    webmarkart -

    Understood.

    I was pretty well aware of what the problem was BUT wanted to show what I had.

    Therefore, if this way is not working, how can I improve upon it?

    My goal is to have the counter number showing above & below the table itself (as mentioned).

    You say: You need to place the loop before the <%= recNum%> (which I am assuming means the first placement of recNum) - if you would be so kind, I would appreciate you modifying what I have showing to encorporate your answer.

    Thanks for the input and the assistance.

  • #4
    New Coder
    Join Date
    Oct 2002
    Location
    Canada (eh)
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Ah well .....

    Guess I am going to stick with the counter number showing at the bottom.

    Thanks for the help.
    Listen! You smell that?

  • #5
    Regular Coder
    Join Date
    Jul 2002
    Location
    Raleigh, NC
    Posts
    484
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You could move the sql statement to the top of the page and load the results as an array. This way you can display the results or counter whenever you want on that page.
    -WebMark Art
    Programming is 80% thinking and 20% spelling

  • #6
    New Coder
    Join Date
    Oct 2002
    Location
    Canada (eh)
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Moving on ...

    Appreciate the input.

    As I mentioned, I am just going to leave it AS IS for the time being; have other facets of the website to concentrate on.

    Thanks for the feedback tho
    Listen! You smell that?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •