egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mysqlendquery problem

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
DJFelipe
Voice


Joined: 20 Oct 2010
Posts: 1

PostPosted: Wed Oct 20, 2010 2:11 pm    Post subject: mysqlendquery problem Reply with quote

Hi There...

My eggdrop says to me that 'mysqlendquery: not mysqltcl handle'

But i cannot find the error...

Code:
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..
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber