The select query will be something like
Code: Select all
mysqlsel $mysql "SELECT * FROM sql_table where last_event < $time"
set mycount [mysqlresult $mysql rows?]
mysqlmap $mysql {id name score kills} {
}
I have googled and searched the forum and found a few matches but I can’t get what I'm trying to do to work and don’t seem to be getting any error messages to help work out why it’s not working.
Once I have the results from the query I need to build a list of id, name, score and kills and sort first on score (DESC) and then on kills (DESC). That bit of the problem I can do with the actual select statement. The bit I'm having problems with is I need to somehow generate an index number for each result starting from 1 and ending with the last result to the query as follows
Code: Select all
Index name score kills
1 name1 100 20
2 name4 95 15
3 name2 82 10
4 name5 82 8
5 name3 60 5
Can anyone offer me any help or guidance with this script?
TIA
Regards
Reserve