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.
 
Soldato
Joined
18 Oct 2002
Posts
15,177
Location
The land of milk & beans
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
 
Associate
OP
Joined
12 Aug 2004
Posts
1,009
Location
Glasgow, Scotland
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 :)
 
Soldato
Joined
12 Jun 2005
Posts
5,361
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