简体   繁体   中英

Autohotkey close database connection

I have made a script using the following library;

http://www.autohotkey.com/board/topic/72629-mysql-library-functions/

to connect to my non-local database. However I'm issuing some max_user_connections problems and I think this is due to the fact that I never close the database connection.

I can't seem to find a way to do that using this library but I am not certain, maybe theres a way to close any connection to the internet or any database or whatever that would work build-in in AHK?

Script:

    hi() {

mysql := new mysql
db := mysql.connect("x","x","x","x")     ; host,user,password,database

if db =
    return

sql = 
(
    UPDATE something
       SET yo = yo+1
     WHERE id = 1
)

result := mysql.query(db, sql)

}

Thanks in advance

The DLL of the AHK script has the mysql_close function, but it's not coded into the AHK library.

You can technically manually call the DLL just like the AHK and see if it'll work.

Since I also need to connect to a MySQL DB via AHK, I'll update this answer when a full solution is available.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM