Help esx_society error

Can someone help me out with this. I’m guessing it’s a Database issue but I honestly don’t see what’s wrong. The addon ect dbs seems fine

I’ve also tried re installing the script and it’s sql

It is looking for something in the database but it is not there. Maybe give it a look?

Have tried that. Re installing script and sql files and it still does that. All the columns and everything is fine

Did you not read the error in the console? It’s right there if you look closely.

@esx_society/server/main.lua:26: attempt to index a nil value (field '?')

Then lets have a look at the function in line 15 to 28 where line 26 is included in esx_society.

MySQL.ready(function()
	local result = MySQL.Sync.fetchAll('SELECT * FROM jobs', {})

	for i=1, #result, 1 do
		Jobs[result[i].name]        = result[i]
		Jobs[result[i].name].grades = {}
	end

	local result2 = MySQL.Sync.fetchAll('SELECT * FROM job_grades', {})

	for i=1, #result2, 1 do
		Jobs[result2[i].job_name].grades[tostring(result2[i].grade)] = result2[i] -- Line 26
	end
end)

Oh look. Seems like you are trying to access result2[i] which doesn’t exist. Because it’s trying to index a nil value, there are probably sql tables missing, which means you forgot to import needed sql tables, in this case you should import the sql tables from esx_jobs, because esx_society literally needs to fetch information from those tables.

esx_jobs

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