<?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/4313" />

	<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>2003-05-05T16:54:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[user]]></name></author>
		<updated>2003-05-05T16:54:20-04:00</updated>

		<published>2003-05-05T16:54:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19863#p19863</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19863#p19863"/>
		<title type="html"><![CDATA[MySQL query's &amp; TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19863#p19863"><![CDATA[
Read the docs! Don't just invent stuff when you're stuck...like<blockquote class="uncited"><div>$table(score)</div></blockquote>Your variable 'row' will contain a list of rows being lists themselves...so to access the first row retrieved you'd have to use [lindex $row 0] and to retrieve the first column of that row it'd be [lindex [lindex $row 0] 0].<br><br>I've never used fastbase, but at least that's how it's supposed to work according to the docs. (<a href="http://www.fastbase.co.nz/fbsql/fbsql.html" class="postlink">http://www.fastbase.co.nz/fbsql/fbsql.html</a>)<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2878">user</a> — Mon May 05, 2003 4:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-05-05T04:22:23-04:00</updated>

		<published>2003-05-05T04:22:23-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=19813#p19813</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=19813#p19813"/>
		<title type="html"><![CDATA[MySQL query's &amp; TCL]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=19813#p19813"><![CDATA[
Hi,<br><br>Let's start with to say I'm a complete newbie in TCL / Eggdrop coding (Coded primarily PHP in my life <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> ). However, I tried allmost everything to find out how this works, but I really wouldn't know where to search. (I tried the search function on this forum also, but that wasn't much of a help either <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> )<br>Well, here is my really basic script <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"> :<div class="codebox"><p>Code: </p><pre><code>set dbhost "*****"set dbuser "*****"set dbpass "*****"set dbname "*****"proc pub_score {nick uhost hand channel arg} {  global usertable botnick dbuser dbname dbpass dbhost   sql connect $dbhost $dbuser $dbpass   sql selectdb $dbname   if {$arg == ""} {    puthelp "NOTICE $nick :USAGE: !score &lt;nick&gt;"    sql disconnect    return 0   } {    set scorez [lrange $arg 0 end]    set row [sql "SELECT score FROM table WHERE user='$scorez'"]    set score [lindex $row 0]    puthelp "NOTICE $nick :$scorez has score $table(score)"    sql disconnect    return 0   }}bind pub - !score pub_score</code></pre></div>In case you completely don't understand what the meaning of this script is : I want to query the value of 'score' from the table 'table' in my mysql database. The login on the database seems to work (it doesn't crash, so I suppose it works). I loaded the fbsql.so script in my conf file. <br>Anyone got any hints for me to go on ? <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> Thanx in advance<p>Statistics: Posted by Guest — Mon May 05, 2003 4:22 am</p><hr />
]]></content>
	</entry>
	</feed>
