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.

mysqltcl | eggdrop 1.6.15 | mysql max 4.0.13 binary-install

Old posts that have not been replied to for several years.
Locked
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

mysqltcl | eggdrop 1.6.15 | mysql max 4.0.13 binary-install

Post by gk^ »

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^
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

There several ways to do this.

Reading tcl-commands.doc will be your best source for this.

Read up on putdcc, putlog
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

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..
m
mortician
Voice
Posts: 37
Joined: Sun Sep 22, 2002 6:35 pm
Location: Tsjakamaka
Contact:

Post by mortician »

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.
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

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^
g
gk^
Halfop
Posts: 70
Joined: Sun Jul 28, 2002 6:23 am
Location: Stockholm, Sweden
Contact:

Post by gk^ »

nevermind last post - i found that it just "pasted" a row into an index in the cute little list... 8)
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

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.
Locked