Well, as I illustrated in my post, either way works, just as long as you write the rest of your code properly...
The following is copied from the tclmysql manual, which should illustrate the difference between the two different options:
Code: Select all
% ::mysql::sel $db "SELECT ID, NAME FROM FRIENDS" -list
{1 Joe} {2 Phil} {3 John}
% ::mysql::sel $db "SELECT ID, NAME FROM FRIENDS" -flatlist
{1 Joe 2 Phil 3 John}
With -list, you get a tcl-list, where each list-item is itself a tcl-list representing one row - having one list item for each column.
Or, in other words, to select the data in row
x column
y, you would use "puts stdout [lindex [lindex $result
x]
y]"
With -flatlist however, you get a tcl-list where each list-items represents one datacell. As the name suggests, the list have been "flattened", where each datacell follows the previous one (making it ideal for "foreach {nick fname lname info time} {" kind of structures, which will extract 5 elements from the list on each run).