My eggdrop says to me that 'mysqlendquery: not mysqltcl handle'
But i cannot find the error...
Code: Select all
proc proc_checkfornews {} {
global db_handle madsadminchan madspubchan dbhost dbuser dbpass dbname
if {[mysqlping $db_handle] != 1} {
putlog "Mysql seems to be gone... trying to reestablish the connetion..."
if {[catch {set db_handle [mysqlconnect -host $dbhost -user $dbuser -password $dbpass -db $dbname]} errmsg]} {
putserv "PRIVMSG $madsadminchan :Scriptfehler! $errmsg"
}
}
putlog "Checking for new Newspostings..."
set sql "SELECT id, channel, text FROM postbot2 ORDER BY id ASC LIMIT 1;"
putlog "SQLDEBUG-> $sql"
set result [mysqlquery $db_handle $sql]
while {[set res [mysqlnext $result]] != ""} {
putserv "PRIVMSG [lindex $res 1] :[lindex $res 2]"
set sql2 "DELETE FROM postbot2 WHERE postbot2.id = [lindex $res 0] LIMIT 1"
putlog "SQLDEBUG-> $sql2"
set result2 [mysqlquery $db_handle $sql2]
mysqlendquery $result2
}
mysqlendquery $result
utimer 10 proc_checkfornews
}