brouznouf / fivem-mysql-async

MySql Async Library for FiveM
MIT License
111 stars 106 forks source link

SCRIPT ERROR: @core/server.lua:13: attempt to index a nil value (global 'MySQL') #159

Closed YannickPerret closed 3 years ago

YannickPerret commented 3 years ago

Hi ! i'm in server side and have this error : SCRIPT ERROR: @core/server.lua:13: attempt to index a nil value (global 'MySQL') My Server code.. Have you some idea why Mysql return nil each time ? Yes in my Manifest @mysql-async/lib/MySQL.lua is in the first.

AddEventHandler('playerConnecting', function(playerName, setKickReason)
    identifiers = GetPlayerIdentifiers(source)
    for i in ipairs(identifiers) do
        print('Player: ' .. playerName .. ', Identifier #' .. i .. ': ' .. identifiers[i])
        print(identifiers[i])
        if i == 1 then
            MySQL.Async.insert('INSERT INTO players (`license`) VALUES (@licence,)',
            { ['licence'] = identifiers[i]},
            function(id)
                print(id)
            end
            )
        end
    end
end)
YannickPerret commented 3 years ago

update my fxserver for more information, and have some bug in my request sql