Feche1320 Posted October 11, 2014 Share Posted October 11, 2014 Hello, is there any way to store a table on inbuilt SQL system? example local table = { name = "me", money = 99999} And save 'table' to SQL.. thanks Link to comment
TAPL Posted October 11, 2014 Share Posted October 11, 2014 Do you realize that SQL is actually table based? Link to comment
'LinKin Posted October 11, 2014 Share Posted October 11, 2014 You can use: toJSON fromJSON Example: local myTable = { name = "me", money = 99999} local JSON_Table = toJSON(myTable) And then you can insert the 'JSON_Table' into the SQL, I think you already know how to, right? And whenever you need it again, just pick it up from the SQL table, and turn it into the "original" Lua table like this: local myTable2 = fromJSON(theValueYouGotFromSQL) Link to comment
Feche1320 Posted October 12, 2014 Author Share Posted October 12, 2014 You can use: toJSON fromJSON Example: local myTable = { name = "me", money = 99999} local JSON_Table = toJSON(myTable) And then you can insert the 'JSON_Table' into the SQL, I think you already know how to, right? And whenever you need it again, just pick it up from the SQL table, and turn it into the "original" Lua table like this: local myTable2 = fromJSON(theValueYouGotFromSQL) Thanks, by the way, is it faster to have a variable with a copy of my SQL database for like, checking if account is already registered? 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