Jump to content

[Help] SQL


XML

Recommended Posts

Hello, I got this weird problem, [Expected db-connection at argument 1]

The script was working fine for a long time, but suddenly this error appeared.

So when i get this error, I restart the resource, And then it works, And the same problem appears again after a while.

Did someone got the same problem before ?

 

Help.

 

Link to comment

I suppose you use dbQuery, so:

_dbQuery = dbQuery --store the original func
function dbQuery (connection, ...)
  local arg = {...}
  if not connection then
    connectionGlobal = dbConnect() --fill it in and change connectionGlobal to wherever you store the connection
    connection = connectionGlobal
  end
  _dbQuery(connection, unpack(arg))
end

Note that this won't work if you use callbacks in dbQuery as it expects the first argument to be the connection.

Also, didn't test this.

Edited by MIKI785
Forgot to use the original func..
  • Thanks 1
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...