.:HyPeX:. Posted November 9, 2014 Posted November 9, 2014 Hey guys, i'm using a database to store stuff and i was wondering if it was possible to have a table inside another table in databases...? Greetz My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
MTA Team botder Posted November 9, 2014 MTA Team Posted November 9, 2014 Do you mean something like toJSON? GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
.:HyPeX:. Posted November 9, 2014 Author Posted November 9, 2014 No, not really, but i could use that too. What i meant is this (or something like it, should work for explainatory purpouses): local db = dbConnect("sqlite", "crap.db") local dbExec( db,"CREATE TABLE IF NOT EXISTS table_MyBootTable();") local dbExec( db,"CREATE TABLE IF NOT EXISTS IN table_MyBootTable table_SubTable(Column1, varchar);") My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
MTA Team botder Posted November 10, 2014 MTA Team Posted November 10, 2014 Do you want to add a column to your first table or SELECT information from 2 tables in one query? GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
Feche1320 Posted November 10, 2014 Posted November 10, 2014 Create a new table lol, dumb question www.host-ar.com.ar
.:HyPeX:. Posted November 10, 2014 Author Posted November 10, 2014 Do you want to add a column to your first table or SELECT information from 2 tables in one query? No, i want to add a table to the first table! @Feche1320 - It would be much easier to have a sub-array for my own purpouses My ingame nick is ~HyPeX~ BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager
Feche1320 Posted November 10, 2014 Posted November 10, 2014 Do you want to add a column to your first table or SELECT information from 2 tables in one query? No, i want to add a table to the first table! @Feche1320 - It would be much easier to have a sub-array for my own purpouses fromJSON and toJSON is what you are looking for.. -- Inserting to DB local table = { name = "Hypex", age = 23, ["eye_color"] = "white" } dbExec(yourdb, "UPDATE yourtable SET information = '" ..toJSON(table).. "'") -- Restoring from DB local qr = dbQuery("SELECT information FROM yourtable") local result = dbPoll(qr, -1) local table = fromJSON(result[1].information) That's a quick example www.host-ar.com.ar
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