| View previous topic :: View next topic |
| Author |
Message |
Fire-Fox Master

Joined: 23 Sep 2006 Posts: 270 Location: /dev/null
|
Posted: Mon Nov 16, 2009 5:04 am Post subject: mysql connect |
|
|
Hey
How do i get the bot to keep connection to the mysql database, without replying "The connection to the mysql server has been lost." almost all the time?
| Code: | ##################
### Mysql path ###
##################
if {![info exists db_handle] } {
set db_handle [mysqlconnect -host xxxx.xxxx.xxxxx -port xxxx -user xxx -password xxxxx -db xxxxxx]
} |
| Code: |
if {[mysqlping $db_handle] != 1} {
putserv "PRIVMSG $channel :The connection to the mysql server has been lost."
return 0
} |
_________________ GreatZ
Fire-Fox | Denmark
Scripts: Relay | Store Text | TvMaze |
|
| Back to top |
|
 |
DarkRaptor Voice

Joined: 15 Apr 2006 Posts: 36 Location: Trois-Rivières, Qc
|
Posted: Mon Nov 23, 2009 12:05 am Post subject: |
|
|
Hi Fire-Fox,
I'm using this in my script.
| Code: |
proc name { all arguments } {
mysqlconnect
conditions
&
commands
mysqlclose
}
|
I'm sure to have a "fresh" connection to the mysql server.
Note: I put "mysqlclose" at each location that the script ends. _________________ DarkRaptor @ irc.undernet.org |
|
| Back to top |
|
 |
|