MYSQL - mysql_close() - close all connections?
#1

Hi all!
I have a question, i didn't found the answer on wiki.
If i open a mysql connection in my gamemode and another mysql connection in a filterscript, when i use mysql_close(); in one of them (gamemode or filterscript), the function will close only script's connection or all mysql connections started by gamemode + filterscript?

I use this: https://sampwiki.blast.hk/wiki/MySQL/R33
Reply
#2

It has a parameter "connectionHandle" its the same value(which defaults to 1) returned by mysql_connect. So no, if for example a filterscript opens a connection, it will have to close it itself.
Reply
#3

Thanks
Reply
#4

It is important to note that if both scripts connect to the same database with the same user and the same password then both scripts will use the same connection handle and hence mysql_close will close the connection in both scripts. This is important to note as it can obviously cause problems. This behavior can be disabled with the "duplicate connections" option.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)