General > Developers Corner
SQL: table from string in row?
(1/1)
Doomed:
In MySQL, is there a way to retrieve a table of information (like in the "Classes" column) rather than just a string or integer? It gets stored as a string, I just dont know of any gmod functions that can directly convert a string to a table. thanks
MrPresident:
That's because MySQL doesn't store data as tables... only has strings or numbers.
You can use the following lua functions to serialize your tables and store/read them from MySQL:
http://wiki.garrysmod.com/page/util/TableToJSON
http://wiki.garrysmod.com/page/util/JSONToTable
Navigation
[0] Message Index
Go to full version