RizoN Posted September 9, 2017 Share Posted September 9, 2017 (edited) Hello, I'm trying to do this: function testFunction(sData, sSomething) local callbackFunction = function(result) outputChatBox(tostring(result)) end -- callback function is defined properly here Database:query(MyHandlerFunction, {callbackFunction, sData}, "SELECT * FROM my_database_table WHERE something=?", sSomething) end function MyHandlerFunction(query, func, data) -- func is nil here, but data is not nil func("hello") -- returns error, as it says that func is nil end testFunction("mydata", "123") I'm using OOP the query function doesn't seem to want to transport my callback function to my handler function, is it a query function limit or something? like it cant transport functions? Edited September 9, 2017 by RizoN Link to comment
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