| View previous topic :: View next topic |
| Author |
Message |
Python Voice
Joined: 21 May 2006 Posts: 2
|
Posted: Sun May 21, 2006 8:05 pm Post subject: Remove {} brackets from Mysql output to chan [SOLVED] |
|
|
Hi I'm making a script to fetch some data from my Mysql DB and putt it into a certain channel.
Im using eggdrop 1.6.17 with mysql.mod.
This is the script..
| Code: | proc sql_gpcs03 { nick uhost handle channel arg } {
global sql_channel
if { $sql_channel == $channel } {
mysql_connect database host user password
set servinf [list]
set servname [mysql_query "SELECT ServName FROM cv_server_details WHERE `SID` = 3"]
set servip [mysql_query "SELECT IP FROM cv_server_list WHERE `SID` = 3"]
set servport [mysql_query "SELECT PORT FROM cv_server_list WHERE `SID` = 3"]
set servmap [mysql_query "SELECT ServMap FROM cv_server_details WHERE `SID` = 3"]
set servclientscur [mysql_query "SELECT Clients_cur FROM cv_server_details WHERE `SID` = 3"]
set servclientsmax [mysql_query "SELECT Clients_max FROM cv_server_details WHERE `SID` = 3"]
set servinf [linsert $servinf end $servname $servip $servport $servmap $servclientscur $servclientsmax]
putserv "PRIVMSG $channel : $servinf"
mysql_close
}
}
|
And this is the output:
(01:50:5 (gP|Python) !gpcs03
(01:51:00) (@gP|Contagion) {{{ gP.CS.03 [NL] - aim_ak-colt2k3}} } {{137.224.240.17} } {{27035} } {{aim_ak_colt2k3} } {{5} } {{14} }
I dont want those stupid {} brackets!
Im sure there's a simple solution for this, but it can't seem to find one with the search (or in any FAQ). |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Mon May 22, 2006 1:46 am Post subject: |
|
|
Use to turn the lists into strings and you should just lappend the information, there is no point in using linsert and whatnot.
edit: Why you use that many queries is beyond me, you should limit your queries by requesting multiple pieces of information with 1 query instead of 1 query for each piece of information.
(I prefer mysqltcl anyway) |
|
| Back to top |
|
 |
Python Voice
Joined: 21 May 2006 Posts: 2
|
Posted: Mon May 22, 2006 8:23 am Post subject: |
|
|
Problem solved thnx to Metroid..
Lock? |
|
| Back to top |
|
 |
|