• TableToJSON returning table
    0 replies, posted
So, I do [code]local function DoEvent(event, typee) local evn = util.TableToJSON(event) local time = os.time() if typee == "Create" then sql.Query( "INSERT INTO eventboard (`uniqueid`, `event`)VALUES ('"..os.time().."', '"..tostring(evn).."')" ) elseif typee == "Modify" then elseif typee == "Remove" then end result = sql.Query( "SELECT event FROM eventboard WHERE uniqueid = '"..time.."'" ) if (result) then local js = (result[1]) print(js) PrintTable(util.JSONToTable(js)) else print("Something went wrong modifying an event!") end end DoEvent({"Swag", "Yoleaux"}, "Create")[/code] (I know it's bad code, this is prototype stage) and js is a table object when printed. Is there any way to fix this, or serialize tables another way? EDIT: Fixed with a little messing around. It was returning tables within tables.
Sorry, you need to Log In to post a reply to this thread.