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 

[MySQL] Join several channels

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Wed May 10, 2006 7:05 pm    Post subject: [MySQL] Join several channels Reply with quote

Hi everybody,

I have been working with mysqltcl for a few days now, but I just can't get it done! Crying or Very sad
What I am looking for, is that the bot join several channels which are in a MySQL database. The table is called channels. It has 2 elements: ID and NAME. Name is the name of the channel.

Which one of you can write a script with use of mysqltcl that he joins the channels which are in the database? I just can't get it done.

Thanks alot! I would really appreciate it:

Greetings, T-Xorcist

PS: I had this script:
Code:
set mysql(conn) [mysqlconnect -user mysqluser -db tbot -password xxxxxx]
foreach res [mysqlsel $mysql(conn) {select name from channels} -flatlist] {
  channel add $res
  putquick "JOIN :$res"
}
mysqlclose $mysql(conn)


But it only joins one channel out the database.
_________________
is-1337.org IRC server!
Back to top
View user's profile Send private message Visit poster's website
dwickie
Halfop


Joined: 21 Aug 2004
Posts: 76
Location: /pub/beer

PostPosted: Thu May 11, 2006 10:33 am    Post subject: Reply with quote

try:

Code:
foreach res [mysqlsel $mysql(conn) "SELECT name FROM channels" -list] { }
Back to top
View user's profile Send private message
T-Xorcist
Halfop


Joined: 14 Nov 2005
Posts: 47
Location: Netherlands

PostPosted: Thu May 11, 2006 11:01 am    Post subject: Reply with quote

Thanks! But it only displays one channel .. there are 2 channels in the database. But it displays 1 channel!! Better than nothing Smile

Do you know how to display all channels which are in the database ?
_________________
is-1337.org IRC server!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests 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