| View previous topic :: View next topic |
| Author |
Message |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Wed May 10, 2006 7:05 pm Post subject: [MySQL] Join several channels |
|
|
Hi everybody,
I have been working with mysqltcl for a few days now, but I just can't get it done!
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 |
|
 |
dwickie Halfop
Joined: 21 Aug 2004 Posts: 76 Location: /pub/beer
|
Posted: Thu May 11, 2006 10:33 am Post subject: |
|
|
try:
| Code: | | foreach res [mysqlsel $mysql(conn) "SELECT name FROM channels" -list] { } |
|
|
| Back to top |
|
 |
T-Xorcist Halfop
Joined: 14 Nov 2005 Posts: 47 Location: Netherlands
|
Posted: Thu May 11, 2006 11:01 am Post subject: |
|
|
Thanks! But it only displays one channel .. there are 2 channels in the database. But it displays 1 channel!! Better than nothing
Do you know how to display all channels which are in the database ? _________________ is-1337.org IRC server! |
|
| Back to top |
|
 |
|