• MySQLoo retrieving data from query issue
    3 replies, posted
Hello again, MySQLoo v9 Github I have bumped into a minor issue when retrieving data from a query. The wiki states that I should use the function "query:getData()" and that it will return a table of data. Instead it returns for example something like this: Query 1E8C8F88 This is how I made the query: local querytest = dbObject:query( "SELECT * FROM leeroys_table WHERE uuid = " .. steamID .. "" ) querytest:start() function querytest.onSuccess( q, data )  text( tostring( q:getData() ), 0 ) end
The data argument should contain all your data. Try http://wiki.garrysmod.com/page/Global/PrintTable on the data.
local querytest = db:query( "SELECT 1" ) function querytest.onSuccess( q, data )    print(tostring( q:getData() ), 0) end querytest:start() This will print "table: 0x3ada8110" for me so either you haven't posted exactly what you are running or there is something seriously wrong in your text() function. You should also always add the callbacks before you start the query (even though currently there is not a race condition that can happen here).
Update: The function actually returns the table in a string. ( Which I forgot to write in the main post ( which is updated now xd ) ) I also solved it: PrintTable( querytest:getData() ) And then it would output the table.
Sorry, you need to Log In to post a reply to this thread.