Hello ! I am exposing my problem, I would like to make an SQL query to display the name of the companies that owns
entreprise_status = 1
the problem, is that my SQL query only returns me the first result, did not find any solution I turn to the forum
Sorry for my English (Google translate life lmao)
RegisterServerEvent('entreprise_jobs_annonce:public_entreprise')
AddEventHandler('entreprise_jobs_annonce:public_entreprise', function()
MySQL.Async.fetchAll("SELECT custome_name FROM entreprise WHERE entreprise_status = @entreprise_status", {['@entreprise_status'] = 1}, function(result)
if result ~= nil then
print(result[1].custome_name)
end
end)
end)
Unfortunately this does not work, the change returns the 2nd name of the company present in my table and not the whole of the porky company name entreprise_status = 1
Problem solved ! Thank you very much ! this would save me more time
Final code .
RegisterServerEvent('entreprise_jobs_annonce:public_entreprise')
AddEventHandler('entreprise_jobs_annonce:public_entreprise', function()
MySQL.Async.fetchAll("SELECT * FROM entreprise WHERE entreprise_status = @entreprise_status ", { ['@entreprise_status'] = 1 }, function(result)
if result ~= nil then
for k,v in pairs(result) do
print(result[k].custome_name)
end
end
end)
end)