Update SQL queries for MySQL2

This commit is contained in:
Tony
2021-09-12 23:42:30 -04:00
parent 21e8c0bb92
commit c1eadcc827
3 changed files with 44 additions and 48 deletions
+2 -2
View File
@@ -306,9 +306,9 @@ end)
RegisterServerEvent('QBCore:Command:CheckOwnedVehicle')
AddEventHandler('QBCore:Command:CheckOwnedVehicle', function(VehiclePlate)
if VehiclePlate ~= nil then
local result = exports.oxmysql:fetchSync('SELECT * FROM player_vehicles WHERE plate=@plate', {['@plate'] = VehiclePlate})
local result = exports.oxmysql:fetchSync('SELECT * FROM player_vehicles WHERE plate = ?', { VehiclePlate })
if result[1] ~= nil then
exports.oxmysql:execute('UPDATE player_vehicles SET state=@state WHERE citizenid=@citizenid', {['@state'] = 1, ['@citizenid'] = result[1].citizenid})
exports.oxmysql:execute('UPDATE player_vehicles SET state = ? WHERE citizenid = ?', { 1, result[1].citizenid })
TriggerEvent('qb-garages:server:RemoveVehicle', result[1].citizenid, VehiclePlate)
end
end