dromer Posted December 13, 2019 Share Posted December 13, 2019 What could be the error? Bad argument @ 'dbExec' [Expected db-connection at argument 1] addEventHandler("onResourceStop", resourceRoot, function() for k,v in pairs(getElementsByType("vehicle")) do saveVehicle(id) end end ) function saveVehicle(id) local vehicle = elements[id] if vehicle then local modelid = getElementModel(vehicle) dbExec(connection, "UPDATE vehicle SET model=? WHERE id=?",modelid, id) end end Link to comment
DNL291 Posted December 13, 2019 Share Posted December 13, 2019 This error is very clear: 'connection' isn't returning a valid db-connection. Show us where 'connection' is defined. Link to comment
dromer Posted December 14, 2019 Author Share Posted December 14, 2019 9 hours ago, DNL291 said: This error is very clear: 'connection' isn't returning a valid db-connection. Show us where 'connection' is defined. The connection runs script start loaded datas local connection = exports["connection"]:getConnection() Link to comment
Moderators Patrick Posted December 14, 2019 Moderators Share Posted December 14, 2019 The problem is in the connection resource. Maybe wrong database details, not exported function or something like that. There must be another error message. Hungarian A probléma a connection resourcen belül lesz. Valószínűleg rossz adatbázis adatokat adtál meg, vagy a getConnection funkció nincs is exportálva. (vagy nem is fut a resource) Lennie kell másik hibaüzenetnek is. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now