So what this sub is supposed to do is read in the top 10 "runners" of a database and display their usernames and amount of runs through a String. The current sub only works for the first runner, the top 1. I'm not sure how to access the other "rows" of the database, the other 9. Any help with that would be much appreciated.
Sub stats_top()
set rs = statsConn.Execute("SELECT TOP 10 `runs`,`username`,`time` FROM `baal` ORDER BY `runs` DESC")
statTopOut="The top ten runners:"
For i = 0 to 9
statUsernames = rs.Fields(1)
statRun = rs.Fields(0)
statTopOut = statTopOut & statUsernames & ": " & statRun & ". "
Next
AddQ statTopOut
End Sub
This sub outputs the first person's stats 10 times.
Sub stats_top()
set rs = statsConn.Execute("SELECT TOP 10 `runs`,`username`,`time` FROM `baal` ORDER BY `runs` DESC")
statTopOut="The top ten runners:"
For i = 0 to 9
statUsernames = rs.Fields(1)
statRun = rs.Fields(0)
statTopOut = statTopOut & statUsernames & ": " & statRun & ". "
Next
AddQ statTopOut
End Sub
This sub outputs the first person's stats 10 times.