ULX
Ulysses
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Help
Search
Login
Register
Ulysses
»
General
»
Developers Corner
»
SQL: table from string in row?
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: SQL: table from string in row? (Read 1646 times)
0 Members and 1 Guest are viewing this topic.
Doomed
Newbie
Posts: 28
Karma: 0
SQL: table from string in row?
«
on:
January 15, 2019, 12:49:34 AM »
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
«
Last Edit: January 15, 2019, 12:56:27 AM by Doomed
»
Logged
MrPresident
Ulysses Team Member
Hero Member
Posts: 2728
Karma: 430
Re: SQL: table from string in row?
«
Reply #1 on:
January 15, 2019, 06:58:41 AM »
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
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
Ulysses
»
General
»
Developers Corner
»
SQL: table from string in row?