GTA V version? 1.46 Up to date? yes Legit or Pirate copy? Legit Steam/CD/Social Club? Steam Windows version? Yes Did you try to delete caches.xml and try again? yes Error screenshot (if any) mysql-async attempting to index nil value (mysql) System specifications What did you do to get this issue? Tried getting values from a table What server did you get this issue on? CitizenFX.log file .dmp files/report IDs
Hi, I’m trying to pull some values from a table in my db using mysql-async. However, it keeps returning the below error.
@doorchat/server.lua:40: attempt to index a nil value (global 'MySQL')
The code is in the server side lua, and the __resource.lua is set up to use the async resource
MySQL.Async.fetchAll("SELECT * FROM `users` WHERE `identifier` = @identifier",{ ['@identifier'] = identifier }, function(result)
if result[1] ~= nil then
if result[1].firstname ~= '' then
local data = result[1]
local charName = tostring(data.firstname) .. " " .. tostring(data.lastname)
local charDOB = tostring(data.dateofbirth)
local charSex = tostring(data.sex)
local charHeight = tostring(data.height)
local job = tostring(data.job)
I’ve tried this resource on both our dev server as well as my home server incase there was some kind of connection issue on the dev server, but the error is the same.
Anyone able to point me in the right direction please? Thanks in advance
Hello, this is a friendly reminder because this is your first time creating a topic (or it has been a while since your last topic) in this category.
Please note that most of the support is provided by the FiveM community on a voluntary basis. We ask you to be patient; there is no guarantee we have a solution to your problem(s). To avoid unnecessary/duplicate topics, please browse the forums before creating a topic.
To improve your chances of your issue(s) being solved, please provide as much information as possible about the issue(s) you are having. Also —whenever possible— please use the template given to you when creating a topic.
Yes, sorry I forgot to mention that, mysql-async is on line 18 and the script we’re working on starts on the very bottom line. We’re also using the ESX framework, which has some resources that uses the exact same line to pull from the table.