[Help] Issue merging async request

Hello all,

I have issue when i try to switch to async mode, I have no error, but my request do not works (can see my command in the chat) here my old request :

function addTow(identifier)
	MySQL:executeQuery("INSERT INTO repairman (`identifier`) VALUES ('@identifier')", { ['@identifier'] = identifier})
end

function remTow(identifier)
	MySQL:executeQuery("DELETE FROM repairman WHERE identifier = '@identifier'", { ['@identifier'] = identifier})
end

function checkIsTow(identifier)
	local query = MySQL:executeQuery("SELECT * FROM repairman WHERE identifier = '@identifier'", { ['@identifier'] = identifier})
	local result = MySQL:getResults(query, {'rank'}, "identifier")
	
	if(not result[1]) then
		TriggerClientEvent('repairman:receiveIsTow', source, "inconnu")
	else
		TriggerClientEvent('repairman:receiveIsTow', source, result[1].rank)
	end
end

And here the async mode I did (seems not working) :


function addTow(identifier)
	MySQL.Async.execute("INSERT INTO repairman (`identifier`) VALUES (@identifier)", { ['@identifier'] = identifier})
end

function remTow(identifier)
	MySQL.Async.execute("DELETE FROM repairman WHERE identifier = @identifier", { ['@identifier'] = identifier})
end

function checkIsTow(identifier)
	MySQL.Async.fetchAll("SELECT * FROM repairman WHERE identifier = @identifier", { ['@identifier'] = identifier}, function (result)
	if(not result[1]) then
		TriggerClientEvent('repairman:receiveIsTow', source, "inconnu")
	else
		TriggerClientEvent('repairman:receiveIsTow', source, result[1].rank)
	end
end)

If you see error please tell me ^^ thanks in advance,
Regards,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.