Jump to content

dbExec warning


dromer

Recommended Posts

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
  • Moderators

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...