Merge pull request #190 from zfbx/main

SQL2 error fix
This commit is contained in:
Kakarot
2021-09-13 02:08:33 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ QBCore.Functions.AddPermission = function(source, permission)
} }
exports.oxmysql:execute('DELETE FROM permissions WHERE license = ?', { QBCore.Functions.GetIdentifier(source, 'license') }) exports.oxmysql:execute('DELETE FROM permissions WHERE license = ?', { QBCore.Functions.GetIdentifier(source, 'license') })
exports.oxmysql:insert('INSERT INTO permissions (name, license, permission) VALUES (?)', { exports.oxmysql:insert('INSERT INTO permissions (name, license, permission) VALUES (?, ?, ?)', {
GetPlayerName(source), GetPlayerName(source),
QBCore.Functions.GetIdentifier(source, 'license'), QBCore.Functions.GetIdentifier(source, 'license'),
permission:lower() permission:lower()
+1 -1
View File
@@ -442,7 +442,7 @@ QBCore.Player.Save = function(source)
-- TODO: Merge these 3 queries into 1 with an on duplicate (citizenid isn't primary so https://stackoverflow.com/a/33495408/3200040 might need to be used) -- TODO: Merge these 3 queries into 1 with an on duplicate (citizenid isn't primary so https://stackoverflow.com/a/33495408/3200040 might need to be used)
local result = exports.oxmysql:fetchSync('SELECT * FROM players WHERE citizenid = ?', { PlayerData.citizenid }) local result = exports.oxmysql:fetchSync('SELECT * FROM players WHERE citizenid = ?', { PlayerData.citizenid })
if result[1] == nil then if result[1] == nil then
exports.oxmysql:insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (?)', { exports.oxmysql:insert('INSERT INTO players (citizenid, cid, license, name, money, charinfo, job, gang, position, metadata) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)', {
PlayerData.citizenid, PlayerData.citizenid,
tonumber(PlayerData.cid), tonumber(PlayerData.cid),
PlayerData.license, PlayerData.license,