<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/2354" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2002-08-14T14:55:16-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/2354</id>

		<entry>
		<author><name><![CDATA[slashem]]></name></author>
		<updated>2002-08-14T14:55:16-04:00</updated>

		<published>2002-08-14T14:55:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9783#p9783</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9783#p9783"/>
		<title type="html"><![CDATA[output of data from mysqltcl ??]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9783#p9783"><![CDATA[
hmm, true<br>Using two queries now.. <br><br>   set info [join [mysqlsel $db "select sid, shortname, prop1, prop2, prop3, longname from listing where shortname = '$blub'" -list]] <br><br>for the first.. <br>I can access each of the different things through [lindex $info 5]<br>I tried it without that join and then I couldn't access them.. I'm now using join, but don't really know why.. I thought join was to go from list-&gt;string.. but I can access them afterwards with lindex, which is a listcommand if I'm not mistaken..<br><br>for the second I use:<br> set goods [join [mysqlsel $db "select goodname from goods where sid = '[lindex $siteinfo 0]'"]]<br><br>This one gives me a problem though..<br>when I output $goods I get "6" .. &lt;- number of rows..<br><br>my question now is, how do I make a while loop or something that gives me the name of each good ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1742">slashem</a> — Wed Aug 14, 2002 2:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2002-08-14T14:12:23-04:00</updated>

		<published>2002-08-14T14:12:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9780#p9780</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9780#p9780"/>
		<title type="html"><![CDATA[output of data from mysqltcl ??]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9780#p9780"><![CDATA[
The query you are using is not suitable for the information you require.<br><br>In a production environment, this would yeild more than twice the amount of data actualy required.<br><br>For this, you should use 2 queries, one you extract the information fromt he first table, and a second to extract the required lines form the second table based on the id returned by the first query.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed Aug 14, 2002 2:12 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[slashem]]></name></author>
		<updated>2002-08-14T12:27:43-04:00</updated>

		<published>2002-08-14T12:27:43-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=9779#p9779</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=9779#p9779"/>
		<title type="html"><![CDATA[output of data from mysqltcl ??]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=9779#p9779"><![CDATA[
I've finally gotten the mysqltcl to work.. but I'm not so good at using it..<br>I can make a query, but can't really get the output of it.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_mad.gif" width="15" height="15" alt=":x" title="Mad"><br><br>the dbase contains two tables.. (see tablenames with example input..)<div class="codebox"><p>Code: </p><pre><code>table: listingsid shortname longname    propertie1 propertie21   sth       something   long       heavytable: goodssid    goodname1          pb1          ag</code></pre></div>the kind of output I wanna be able to make is something like:<br>1st line&gt; item: <strong class="text-strong">sth</strong> (<strong class="text-strong">something</strong>) properties: <strong class="text-strong">long, heavy</strong><br>2nd line&gt;goods: <strong class="text-strong"> pb ag </strong><br><br>The BOLD things, are the ones that have to be retrieved from the dbase..<br><br>The query I now use is:<div class="codebox"><p>Code: </p><pre><code>set db [mysqlconnect -host localhost]mysqluse $db slashemset outp [mysqlsel $db "select shortname, longname, propertie1, propertie2, goodname from listing, goods where shortname = 'sth' and where listing.sid == goods.sid"]</code></pre></div>I executed the query in the mysql shell and the kind of table you get from it is:<div class="codebox"><p>Code: </p><pre><code>+-----------+-----------------------+---------+--------+-----------+| shortname | longname              | prop1   | prop2  | gname     |+-----------+-----------------------+---------+--------+-----------+| sth       | something             | long    |  heavy | PB        || sth       | something             | long    |  heavy | AG        || sth       | something             | long    |  heavy | PRL       |</code></pre></div>so, the query works, and gets me my info.<br>All I have a problem with is extracting the info out of the $outp var<br>..<br>I've been messing around with stuff like<br>mysqlmap $db {shortname longname ... gname} {lappend result $shortname $longname .. $gname}<br>putserv "PRIVMSG $chan :$shortname $longname ... $gname"<br>but I can't build up the correct output.. <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_sad.gif" width="15" height="15" alt=":(" title="Sad"><br><br>Is there anyone who would be willing to make me understand how the retrieving of the data works ? plz ? <br><br>thx in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1742">slashem</a> — Wed Aug 14, 2002 12:27 pm</p><hr />
]]></content>
	</entry>
	</feed>
