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.

[MySQL] Not doing anything with mysqltcl

Help for those learning Tcl or writing their own scripts.
Post Reply
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

[MySQL] Not doing anything with mysqltcl

Post by T-Xorcist »

Hi all!

I just started to work with mysqltcl, but I can't find the error. I have the following code:

Code: Select all

proc test {nick host hand chan arg} {
  package require mysqltcl
  set mysql(conn) [mysqlconnect -host localhost -user tbot -db tbot -password xxxxxxx]

  [b][u]set query "SELECT id FROM channels WHERE name = 'T-Xorcist'"
  set chanid [mysqlsel $mysql(conn) $query -list][/u][/b]

  mysqlclose $mysql(conn)
}
The wanabee bold/underlined lines are the problem! If I remove that line, it works.

What is wrong with this script? I am looking for 3 hours now :?

Thanks in advance!
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Re: [MySQL] Not doing anything with mysqltcl

Post by demond »

T-Xorcist wrote: What is wrong with this script? I am looking for 3 hours now :?
the 'wanabee bold/underlined lines'?
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use

Code: Select all

 tag when posting logs, code
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

Post by T-Xorcist »

Hm, my MySQL user / password wasn't correct :S

Which is very strange, because it is there. Oh wel, sorry for bothering you guys

1 more question: how can I remove all the channels at ones? like:
channel remove * ? Is that possible?
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

T-Xorcist wrote:1 more question: how can I remove all the channels at ones? like:
channel remove * ? Is that possible?
Try it. I am for sure NOT going to try it on my bot :D.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
T
T-Xorcist
Halfop
Posts: 47
Joined: Mon Nov 14, 2005 6:36 pm
Location: Netherlands
Contact:

Post by T-Xorcist »

But what is it? :P Any ideas?
Post Reply