How can I get data from the database php to my client and print it so it says the name?


I want to get the vehicle_name and print the name into a menu.

I have tried this in the server.lua:

MySQL.Async.fetchAll(SELECT vehicles FROM `vrp_user_vehicles`), function (result) end) end

But I doesn’t work and I don’t know how to get it in client.lua

MySQL.Async.fetchAll("SELECT vehicle_name FROM `vrp_user_vehicles` WHERE vehicle_plate = @plate", {['plate'] = plate}, function(result)
	if result[1] ~= nil then
		--Return to client side here ? e.g cb(result[1].vehicle_name)
	end
end)

This has to be in the server.lua but you might also add a WHERE clause to your MySQL request. (Like searching by plate).
Return it to the client using the model of your actual script of by making a Servercallback.