I can make a query, but can't really get the output of it..

the dbase contains two tables.. (see tablenames with example input..)
Code: Select all
table: listing
sid shortname longname propertie1 propertie2
1 sth something long heavy
table: goods
sid goodname
1 pb
1 ag
1st line> item: sth (something) properties: long, heavy
2nd line>goods: pb ag
The BOLD things, are the ones that have to be retrieved from the dbase..
The query I now use is:
Code: Select all
set db [mysqlconnect -host localhost]
mysqluse $db slashem
set outp [mysqlsel $db "select shortname, longname, propertie1, propertie2, goodname from listing, goods where shortname = 'sth'
and where listing.sid == goods.sid"]
Code: Select all
+-----------+-----------------------+---------+--------+-----------+
| shortname | longname | prop1 | prop2 | gname |
+-----------+-----------------------+---------+--------+-----------+
| sth | something | long | heavy | PB |
| sth | something | long | heavy | AG |
| sth | something | long | heavy | PRL |
All I have a problem with is extracting the info out of the $outp var
..
I've been messing around with stuff like
mysqlmap $db {shortname longname ... gname} {lappend result $shortname $longname .. $gname}
putserv "PRIVMSG $chan :$shortname $longname ... $gname"
but I can't build up the correct output..

Is there anyone who would be willing to make me understand how the retrieving of the data works ? plz ?
thx in advance