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.
Old posts that have not been replied to for several years.
gk^
Halfop
Posts: 70 Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:
Post
by gk^ » Wed Jun 04, 2003 5:08 am
I have some trouble using mysqltcl.
I've read the doc (witch isnt that much of a help
) lots of times - but I cant figure out how to print the right data.
I use a select * from table, but how in the world should I put it out on ie. the partyline?
Yours truly
gk^
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Wed Jun 04, 2003 6:13 am
There several ways to do this.
Reading tcl-commands.doc will be your best source for this.
Read up on putdcc, putlog
gk^
Halfop
Posts: 70 Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:
Post
by gk^ » Wed Jun 04, 2003 6:47 am
yes well, that isnt really a problem. Maybe I where unclear about my problem - I can putout like "{1 " or "1" but nothing more - should I use things such as lindex? Checking how to use them right now so that I can try..
mortician
Voice
Posts: 37 Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:
Post
by mortician » Wed Jun 04, 2003 7:31 am
yeah, using mysqlsel?
[lindex [mysqlsel ...] 0] is the first selected row, ...
and another lindex to select the correct column
It is a mistake to think you can solve any major problems just with potatoes.
gk^
Halfop
Posts: 70 Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:
Post
by gk^ » Wed Jun 04, 2003 7:46 am
ok, well now I made it with -flatlist (witch is really useless when you think about for a secound).
Code: Select all
set mysql_handle [mysqlconnect -h localhost -user eggdrop -password xxxxxxx -db eggdrop]
set mysql_res [mysqlsel $mysql_handle "SELECT * FROM test" -list]
putlog "00: [lindex $mysql_res 0]"
but I cant figure out how to use
[lindex [mysqlsel ...] 0] is the first selected row, ...
and another lindex to select the correct column
I guess that its just to try but it would save me lots of time if you could give me and example..
Yours truly
gk^
gk^
Halfop
Posts: 70 Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:
Post
by gk^ » Wed Jun 04, 2003 8:02 am
nevermind last post - i found that it just "pasted" a row into an index in the cute little list...
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Wed Jun 04, 2003 12:18 pm
The flatlist option is very helpful, however, is mainly only there as a compatability feature.
The "foreach" command, allows you to pick more than a single item from a list in one go
Code: Select all
set list {
AA
AB
AC
AD
BA
BB
BC
BD
DA
DB
DC
DD
}
foreach {a b c d} $list {some code }
You should get an idea of what flat list is for now. You can cycle through rows very qucily, with access to values instantly.