Jump to content

[HELP] How can i load data from MySQL to a player variable?


alexxnder

Recommended Posts

  

9 minutes ago, Tekken said:

 


local data = dbPoll("your data to be returned using normal MySQL");

for i,v in ipairs(data) do

v["var_name_in_db"]

end

Please note that this is a simple example for better understanding please read dbPoll wiki page.

Ok, but how can i assign the data from mysql to a player variable ?

Link to comment
6 minutes ago, Tekken said:

What do you mean by player variable ?

like this:

local data = dbPoll("your data to be returned using normal MySQL");

for i,v in ipairs(data) do

    player_variable = v["var_name_in_db"]

end

or

for i,v in ipairs(data) do   

      skin = v["var_name_in_db"]

end

I don't know if you understand what i want to say, i don't have a good english.

Edited by alexxnder
Link to comment
Just now, Tekken said:

Well you should use a tabel to store player element like this 

playersTable = {}
 

and after to store it you do this 

playersTable[thePlayer] = v[1]
 

you got it?

Yes, i got it, thank you bro btw the peoples from this forum are really great and friendly and i'm glad to see that! :D 

Link to comment
6 minutes ago, Tekken said:

You’re welcome. ;) 

You can also do

tablePlayers[player]["skin"] = skinid

 

for a better way of storing data than get/setElementData

Got it :D  (Mersi) :D 

In caz de o sa mai am nevoie de ajutor o sa te mai contactez daca nu te deranjeaza :) chiar sunt surprins de cate chestii poti face pe acest client

Edited by alexxnder
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...