Arrays from Basic Table Field
Posted: Thu May 17, 2012 5:23 am
Hi,
I connected my code to a MySQL database, created a full table and everything, and am trying to deal with the data I get back from the database without having to run a million queries. Basically, the table I get back (placed in a basic Table Field) is 12 rows with 17 columns (the first column being simply 1-12). I'm having issues putting them into arrays. I can't select less of the table, because I'm taking every cell of the table and putting it into the code somewhere, and I need to be able to call it easily. I'm convinced I'm doing something wrong. I'm putting the table call below in case it's important. Any help would be appreciated!
I connected my code to a MySQL database, created a full table and everything, and am trying to deal with the data I get back from the database without having to run a million queries. Basically, the table I get back (placed in a basic Table Field) is 12 rows with 17 columns (the first column being simply 1-12). I'm having issues putting them into arrays. I can't select less of the table, because I'm taking every cell of the table and putting it into the code somewhere, and I need to be able to call it easily. I'm convinced I'm doing something wrong. I'm putting the table call below in case it's important. Any help would be appreciated!
Code: Select all
put "RowNum VARCHAR(40), CharName VARCHAR(40), PlayerName VARCHAR(40), GroupNum VARCHAR(999), CharNum VARCHAR(999), G" & tGroupNum & "C1Text VARCHAR(999), G" & tGroupNum & "C2Text VARCHAR(999), G" & tGroupNum & "C3Text VARCHAR(999), G" & tGroupNum & "C4Text VARCHAR(999), G" & tGroupNum & "C5Text VARCHAR(999), G" & tGroupNum & "C6Text VARCHAR(999), G" & tGroupNum & "C7Text VARCHAR(999), G" & tGroupNum & "C8Text VARCHAR(999), G" & tGroupNum & "C9Text VARCHAR(999), G" & tGroupNum & "C10Text VARCHAR(999), G" & tGroupNum & "C11Text VARCHAR(999), G" & tGroupNum & "C12Text VARCHAR(999)" into tFields
put "G" & tChosenTable & "TextTable" into tTableName -- get table in form "G1TextTable"
put "SELECT * FROM " & tTableName into tSQL
put revDataFromQuery(tab, cr, gConnectionID, tSQL, tFields) into tData
if item 1 of tData = "revdberr" then
answer error "There was a problem querying the database:" & cr & tData
exit to top
else
put tData into field "DataText"
end if