• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

db.executeQuery()

DedicatedOT

New Member
Joined
Jun 13, 2009
Messages
977
Reaction score
4
Location
USA
so after I executeQuery(), how do I close the db connection?

I tried db.close(), db:close(), neither worked because it said something about cur:close() being NIL.
 
[12/08/2009 16:12:27] data/db.lua:73: attempt to index field 'cur' (a nil value)
[12/08/2009 16:12:27] stack traceback:
[12/08/2009 16:12:27] data/db.lua:73: in function 'free'
 
But if you don't close it,... you'll have like 500+ connections open and your db will soon have "Too many connections."

Is there any similar functions to mysql_close()?
 
It doesn't work like that. The server has 1 open connection with the database and the queries you execute through db.executeQuery are executed over that 1 open connection.
 
Yes but I'm not talking about the server's default connection with the server, I'm talking about whenever I connect to the db. How do I close it since cur:close() doesn't work.
 
With php? Because if you connect via lua you connect via your ot server to the database who already has an open connection and won't be closed untill you shut down the server.
 
Back
Top