./BlackBird# Posted July 5, 2014 Share Posted July 5, 2014 Can i insert table into Sql Cloumn ? Link to comment
./BlackBird# Posted July 5, 2014 Author Share Posted July 5, 2014 i mean like this local t = {"Test"} executeSQLQuery("INSERT INTO TestSql(value) VALUES(?)", t) Link to comment
Tete omar Posted July 5, 2014 Share Posted July 5, 2014 You can use the pair of the JSON functions; toJSON fromJSON They can be used to store a Lua table into SQL tables. Link to comment
'LinKin Posted July 5, 2014 Share Posted July 5, 2014 @Tete: Can you give an example of it? Link to comment
Tete omar Posted July 5, 2014 Share Posted July 5, 2014 Alright, local informative_table = { foo = "bar", green = { 0, 255, 0 }, table_name = "informative_table" } local JSON_structure = toJSON ( informative_table ) --[[ JSON_structure is a variable that contains a string containing a copy of 'informative_table', whenever we need this table, we can produce it using fromJSON ( JSON_structure ), e.g: local informative_table_2 = fromJSON ( JSON_structure ) and here we have another copy of 'informative_table' --]] 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