Jump to content

mysql TO for in TO table TO triggerClientEvent problem


kuwalda

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...