gm_tmysql4 icon indicating copy to clipboard operation
gm_tmysql4 copied to clipboard

callbacks not running

Open Nocturnal337 opened this issue 1 year ago • 1 comments

win11

function lts.chars.getMoney(id, currencyIndex, callback)
    print("getting..")
    local sql = string.format("SELECT `currency_%d` FROM `characters` WHERE `id` = %d;", currencyIndex, id)
    print(sql)
    db:Query(sql, function(result)
        if result and #result > 0 then
            callback(result[1][string.format("currency_%d", currencyIndex)])
        else
            callback(nil)
        end
    end)
end

lts.chars.getMoney(1, 1, function(currency)
    print("Currency 1 Amount: ", currency)
end)

Callback refuses to run, i could be retarded tho.

Nocturnal337 avatar Aug 10 '24 08:08 Nocturnal337

I should probably note that entry queries work just fine, it's made tables and data and connects perfectly, I've tested the SQL that the script above makes inside of phpmyadmin, the SQL is fine with no errors. Ive also tested it with the code example on the readme - though replacing it with the SQL script that works in phpmyadmin, the callback function just doesnt seem to run whatsoever

Nocturnal337 avatar Aug 11 '24 04:08 Nocturnal337

#24

aStonePenguin avatar Feb 24 '25 23:02 aStonePenguin