Closed TheRealCrappyGamer closed 4 years ago
I am having the same issue at the moment and I also can't trigger client events within the callback.
Any solution for this? Currently this lib is unusable
MySQL.Async.fetchAll('SELECT * FROM player', {}, function(players)
print(players[1].name)
end)
This doesn't help with storing the value outside of the callback, or updating a variable while inside the callback.
On Thu, Feb 20, 2020, 4:20 AM Rubylium notifications@github.com wrote:
MySQL.Async.fetchAll('SELECT * FROM player', {}, function(players) print(players[1].name) end)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/brouznouf/fivem-mysql-async/issues/116?email_source=notifications&email_token=AAKAVX3ACIHQODKPPT6P333RDZDPPA5CNFSM4KI6R5B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEMMNF6A#issuecomment-588829432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKAVX7ERNBGMH276AKANYDRDZDPPANCNFSM4KI6R5BQ .
An example is this:
if checkPlayerExists(identifier) then
print("The user exists")
end
function checkPlayerExists(identifier)
MySQL.Async.fetchAll('SELECT * FROM `users` WHERE `identifier` = @identifier',
{
['@identifier'] = identifier,
}, function(result)
if #result > 0 then
return true
end
end)
end
I have the same problem here, even in the bugged IVMP I can work with the returned value and not here ...
When trying to use a MySql.Async.fetchAll(), inside of the callback, I cannot seem to get variables to be set and accessible outside of the callback.
I have access to a variable outside of the callback, but once I change it in the callback, it's not updated outside of it. Is there a way to pass the variable in so that I can manipulate it and get it back out?