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

	<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>2010-04-30T14:56:50-04:00</updated>

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

		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2010-04-30T14:56:50-04:00</updated>

		<published>2010-04-30T14:56:50-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92985#p92985</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92985#p92985"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92985#p92985"><![CDATA[
correct<br><br>the command applies to random between 0 and limit-1, so if limit is 100, the max value is 99, sorry.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Fri Apr 30, 2010 2:56 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-04-30T13:22:22-04:00</updated>

		<published>2010-04-30T13:22:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92981#p92981</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92981#p92981"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92981#p92981"><![CDATA[
raider2k:<br>Please re-read the documentation for rand:<blockquote class="uncited"><div>  rand &lt;limit&gt;<br>    Returns: a random integer between 0 and limit-1<br>    Module: core</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Fri Apr 30, 2010 1:22 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[raider2k]]></name></author>
		<updated>2010-04-30T12:44:00-04:00</updated>

		<published>2010-04-30T12:44:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92980#p92980</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92980#p92980"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92980#p92980"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>SELECT COUNT(*) FROM `news`</code></pre></div>is most probably the best idea since selecting all rows, putting them into list and then incr every entry is a waste of data and also takes longer<br><br>about rand: the syntax is [rand ?maximum?] which means a random number between 0 and ?maximum? is being chosen<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=9589">raider2k</a> — Fri Apr 30, 2010 12:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-04-28T14:15:14-04:00</updated>

		<published>2010-04-28T14:15:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92961#p92961</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92961#p92961"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92961#p92961"><![CDATA[
0 through n-1, where n is the first argument on the command line.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Apr 28, 2010 2:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MUSUL]]></name></author>
		<updated>2010-04-28T13:54:54-04:00</updated>

		<published>2010-04-28T13:54:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92960#p92960</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92960#p92960"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92960#p92960"><![CDATA[
ok ty, working with mysql::result. Now i have another doubt.<br><br>Using rand function like this:<br><br>set n [rand 5]<br><br>what's the range for the rand? 1-5? 1-4?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11188">MUSUL</a> — Wed Apr 28, 2010 1:54 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[nml375]]></name></author>
		<updated>2010-04-28T13:28:54-04:00</updated>

		<published>2010-04-28T13:28:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92959#p92959</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92959#p92959"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92959#p92959"><![CDATA[
Either use the COUNT() SQL-function in your query to return the number of matching records, or consider using the ::mysql::result command with the "rows" option<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=8052">nml375</a> — Wed Apr 28, 2010 1:28 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[MUSUL]]></name></author>
		<updated>2010-04-28T13:21:28-04:00</updated>

		<published>2010-04-28T13:21:28-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=92958#p92958</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=92958#p92958"/>
		<title type="html"><![CDATA[Count msyql output]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=92958#p92958"><![CDATA[
Hello,<br><br>How can count all the results from a sql query? Im trying this:<br><div class="codebox"><p>Code: </p><pre><code>set sql "SELECT id FROM news"set query [mysql::query $db_handle $sql]if {[set row [mysqlnext $query]] != ""} { incr n 1 }putquick "PRIVMSG #test:$n news registered."</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=11188">MUSUL</a> — Wed Apr 28, 2010 1:21 pm</p><hr />
]]></content>
	</entry>
	</feed>
