-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsql.lua
More file actions
31 lines (31 loc) · 842 Bytes
/
sql.lua
File metadata and controls
31 lines (31 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function ExecuteSql(query)
local IsBusy = true
local result = nil
if PET.Mysql == "oxmysql" then
if MySQL == nil then
exports.oxmysql:execute(query, function(data)
result = data
IsBusy = false
end)
else
MySQL.query(query, {}, function(data)
result = data
IsBusy = false
end)
end
elseif PET.Mysql == "mysql-async" then
MySQL.Async.fetchAll(query, {}, function(data)
result = data
IsBusy = false
end)
elseif PET.Mysql == "ghmattimysql" then
exports.ghmattimysql:execute(query, function (data)
result = data
IsBusy = false
end)
end
while IsBusy do
Citizen.Wait(0)
end
return result
end