gm_tmysql4
gm_tmysql4 copied to clipboard
callbacks not running
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.
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
#24