View Full Version : Total Records Found - Top & Bottom

11-05-2002, 10:55 PM
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%>

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

<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>

Do Until SQLqry.EOF
recNum = recNum + 1

SQL Query results go here



<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 %>

function OnLoads()
document.all.topRw.innerText = document.all.bottomRw.innerText

11-05-2002, 11:06 PM
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%>

11-05-2002, 11:21 PM
webmarkart -


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. :)

11-07-2002, 05:49 PM
Guess I am going to stick with the counter number showing at the bottom.

Thanks for the help.

11-07-2002, 10:02 PM
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.

11-07-2002, 10:57 PM
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 :)