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

	<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>2008-12-01T12:29:21-04:00</updated>

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

		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2008-12-01T12:29:21-04:00</updated>

		<published>2008-12-01T12:29:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86033#p86033</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86033#p86033"/>
		<title type="html"><![CDATA[Loop Help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86033#p86033"><![CDATA[
Since you are using lists, have you considered using a <strong class="text-strong">foreach</strong>-loop? Saves you the hazzle of manually retrieving the row item for each iteration.<br><br>I am somewhat puzzled by why you use index $i rather than index 0 in your second query. Being separate tables, there is no way of guaranteeing the same ordering, especially without any sorting directive.<br>In fact, I would suggest you do a (sql)join instead, which would actually save you one query along with having all the info available at once.<br><br>That would be done something like below, edit to suite your needs. If needed, use some sql-client to verify the output of the query.<div class="codebox"><p>Code: </p><pre><code>set sql "SELECT ip.ircusers, username.ircusers, joindate.forumusers FROM ircusers, forumusers WHERE username.ircusers = username.forumusers AND ip.ircusers = '[mysqlescape $text]'"foreach [list ip username joindate] [mysqlsel $sql -flatlist] { #puthelp "PRIVMSG somewhere :IP: $ip, Username: $username, Join date: $joindate"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Mon Dec 01, 2008 12:29 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Rolet]]></name></author>
		<updated>2008-12-01T08:37:07-04:00</updated>

		<published>2008-12-01T08:37:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=86029#p86029</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=86029#p86029"/>
		<title type="html"><![CDATA[Loop Help]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=86029#p86029"><![CDATA[
hey i made this code for my ircd network but it seems the loop wont work, it will show one user but if 2 users have the same ip it wont, any help would be greatful, code below <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><br><div class="codebox"><p>Code: </p><pre><code>       set sql "SELECT ip, username FROM `ircusers` WHERE ip = '$text'"       set result [mysqlsel $db_handle $sql -list]       if {$result &gt; 0} {for {set i 1} {$i &lt; 10} {incr i 1} {        set record [lindex $result $i];       set ip [lindex $record 0];       set username [lindex $record 1];       set sql2 "SELECT joindate FROM `forumusers` WHERE username='$username'"       set result2 [mysqlsel $db_handle $sql2 -list]        set record2 [lindex $result2 $i];        set joindate [lindex $record2 0]; </code></pre></div>also tried loop as <div class="codebox"><p>Code: </p><pre><code>for {set i 0} {$i &lt; 10} {incr i} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=10337">Rolet</a> — Mon Dec 01, 2008 8:37 am</p><hr />
]]></content>
	</entry>
	</feed>
