kuwalda Posted July 29, 2014 Share Posted July 29, 2014 So basicly what I wanted to do here is select all accounts from database, who is part of any organisation. Later on, I want to pack up those accounts in table and send them to Client side with triggerClientEvent. The problem is - how can I put them in table and then "unpack" them properly in gridlist? local accountList = mysql_query(handler,"SELECT AccountName, org_rank FROM accounts WHERE organizacija = '"..row["organizacija"].."';") table = {} for accountList,row in mysql_rows_assoc(accountList) do --add up them in table, something like this --table[AccountName] = org_rank end triggerClientEvent( thePlayer, "requestOrgGUIPanel", thePlayer, table{} ) --so later I can use it orgPanelGUI.gridlist[1] = guiCreateGridList(9, 101, 252, 265, false, orgPanelGUI.window[1]) guiGridListAddColumn(orgPanelGUI.gridlist[1], "UserName", 0.5) guiGridListAddColumn(orgPanelGUI.gridlist[1], "Rank", 0.5) for i = 1, 3 do guiGridListSetItemText(orgPanelGUI.gridlist[1], row, 1, ... , false, true) guiGridListSetItemText(orgPanelGUI.gridlist[1], row, 2, ..., false, true) end Link to comment
Castillo Posted July 29, 2014 Share Posted July 29, 2014 Use a for loop to add every account to the grid list. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now