PDA

View Full Version : loop inside a loop


fogofogo
12-14-2005, 11:49 AM
Hi All,

Not sure if this is possible, but i am trying to place one type of loop inside another. I'm trying to display a list of records from a database on a page and then another loop to assign a number to it

for example :

1. record
2. record
3. record

I would normally just create a feild for this in the database, but in this case I can do that.

Here is my code :

'Loop through the recordset
Do While not rsScores.EOF

' heres the part where i am trying to add the numbers
For index = 1 to 10 STEP 1
Response.Write(index)


'Write the HTML to display the current record in the recordset
Response.Write ("<br>")
Response.Write (rsScores("Name"))
Response.Write ("<br>")
Response.Write (rsScores("Score"))
Response.Write ("<br>")

Next

'Move to the next record in the recordset
rsScores.MoveNext

Loop


any ideas?

thanks

fogofogo
12-14-2005, 12:10 PM
fixed. Thanks anyway.