This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

mysqlendquery problem

Help for those learning Tcl or writing their own scripts.
Post Reply
D
DJFelipe
Voice
Posts: 1
Joined: Wed Oct 20, 2010 2:09 pm

mysqlendquery problem

Post by DJFelipe »

Hi There...

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
}   
[Edit] Script updated but the error is still there..
Post Reply