brouznouf / fivem-mysql-async

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

fetchAll returns a weird table? #167

Closed iWanheda closed 3 years ago

iWanheda commented 3 years ago

Hello, I'm building my framework, using this piece of code:

MySQL.Async.fetchAll( 'SELECT * FROM items', { },
    function( res )
        Utils.Logger.Debug( Utils.Misc.DumpTable( res[1] ) )

        if res[1] ~= nil then
            for k, v in pairs( res[1] ) do
                Utils.Logger.Debug( ( 'Adding %s (%s) to the item list!' ):format( v, k ) )

            end
        end
    end )

Image

Which doesn't make sense, table should be:

{
    {
        name = "vodka",
        label = "Vodka"
    }
}
iWanheda commented 3 years ago

Just read that you want help in the discord, not here

edit: link isn't valid anymore