Sending variable to top of page?

Associate
Joined
12 Aug 2004
Posts
1,009
Location
Glasgow, Scotland
Hi there,

After searching/looping through a database and bringing back x amount of results, i'd like the x variable to appear at the top of the page after it has finished searching ... is this possible?

Cheers,

Steven.
 
all you need to do is run your query at the top of the page, and then loop around the resulting recordset afterward. a bit of psuedocode...

SQL = "SELECT * FROM Wherever WHERE Whatever LIKE '%Something%'"
create RS from SQL
x = RS.Recordcount

<html>Your search returned X results...

RS.loop
display results
RS.close

</html>

Hope this helps
 
If I remember correctly, its a little awkward to get the recordcount from a results set, you need to specify certina options in the record set when you open it
 
Spunkey said:
all you need to do is run your query at the top of the page, and then loop around the resulting recordset afterward. a bit of psuedocode...

SQL = "SELECT * FROM Wherever WHERE Whatever LIKE '%Something%'"
create RS from SQL
x = RS.Recordcount

<html>Your search returned X results...

RS.loop
display results
RS.close

</html>

Hope this helps

yeah, but i'm doing a few if statements within a couple of loops as well, and i need the variable that appears at the bottom of the page to somehow appear at the top :confused:

cheers for the comments so far :)
 
I may be missing the point, but surely you would just construct the html first and then output it.

EDIT:

Do sql statement that counts the number of returned records?
 
Last edited:
Back
Top Bottom