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

	<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-31T11:34:20-04:00</updated>

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

		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-31T11:34:20-04:00</updated>

		<published>2003-05-31T11:34:20-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20988#p20988</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20988#p20988"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20988#p20988"><![CDATA[
ok all sorted now thanks<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Sat May 31, 2003 11:34 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-05-30T20:00:07-04:00</updated>

		<published>2003-05-30T20:00:07-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20962#p20962</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20962#p20962"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20962#p20962"><![CDATA[
A query is a a SQL statment.<br><br>After you have finished with teh data a query returns, you need to tell the Tcl library as such.<br><br>Usualy ending the query at all the exit points of a proc (IE, any place before a return, or where the script stops)_<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Fri May 30, 2003 8:00 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-30T18:07:24-04:00</updated>

		<published>2003-05-30T18:07:24-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20958#p20958</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20958#p20958"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20958#p20958"><![CDATA[
right new thing.<div class="codebox"><p>Code: </p><pre><code>bind msg - login inv_1load /home/almighty/eggdrop/scripts/sql/fbsql.soproc inv_1 { nick uhost hand arg } {        global chan_1        set arg [split $arg]        set user [lindex $arg 0]        set pass [lindex $arg 1]        sql startquery "SELECT * FROM tbl_member WHERE username = '$user' AND password = '$pass'"        sql endquery        sql startquery        if {[sql numrows] == 0} {        sql endquery        putserv "PRIVMSG $nick :Invalid password or username!"        putserv "PRIVMSG #ae-hc :\0034Invalid Login:\003 $nick (Username: $user)"        putcmdlog "$nick has failed to log in using $user as a username"        } else {        sql endquery        putserv "PRIVMSG #ae-hc :\0039Successful Login:\003 $nick (Username: $user)"        putquick "invite $nick $chan_1"        putcmdlog "$nick has successfully logged in using $user as a username"        sql disconnect        }}</code></pre></div>right the error message im getting in the log files is:<div class="codebox"><p>Code: </p><pre><code>[23:01] Tcl error [inv_1]: Another query cannot be made until the current query has been finished with "sql endquery".</code></pre></div>i no i need to use sql endquery except im not sure where to put them, as does a query count as mysql or tcl commands?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Fri May 30, 2003 6:07 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-29T15:59:51-04:00</updated>

		<published>2003-05-29T15:59:51-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20912#p20912</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20912#p20912"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20912#p20912"><![CDATA[
ok well ive removed the conn variable out of it however it now says<br>[20:55] Tcl error [inv_1]: sql query statement; you are not connected to a mysql server yet (sql connect).<br><br>the sql connect code is:<br>sql connect localhost user "pass"<br>sql selectdb almighty<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Thu May 29, 2003 3:59 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-05-29T04:49:44-04:00</updated>

		<published>2003-05-29T04:49:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20898#p20898</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20898#p20898"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20898#p20898"><![CDATA[
I don't think you need $conn anyhow.<br><br>I thought fbsql provided multiple commands sets, rather than handle based connections?<br><br>IE, for a connection to SQL server 1, you use "sql", for SQL server 3, use "sql3".<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Thu May 29, 2003 4:49 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[spock]]></name></author>
		<updated>2003-05-28T20:11:40-04:00</updated>

		<published>2003-05-28T20:11:40-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20888#p20888</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20888#p20888"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20888#p20888"><![CDATA[
conn is defined outside the of procedure<br><br>( hint: global conn / $::conn )<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2369">spock</a> — Wed May 28, 2003 8:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-28T13:36:06-04:00</updated>

		<published>2003-05-28T13:36:06-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20878#p20878</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20878#p20878"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20878#p20878"><![CDATA[
<div class="codebox"><p>Code: </p><pre><code>bind msg - login inv_1# Script starts nowload /home/almighty/eggdrop/scripts/sql/fbsql.soset conn [sql connect localhost ***** "*****"]sql selectdb almighty $connproc inv_1 { nick uhost hand arg } {        global chan_1        set arg [split $arg]        set user [lindex $arg 0]        set pass [lindex $arg 1]        set stuff "SELECT * FROM tbl_member WHERE username = '$user' AND password = '$pass'"        sql query $conn $stuff        if {[sql numrows] == 0} {        sql endquery $stuff        putserv "PRIVMSG $nick :Invalid password or username!"        putserv "PRIVMSG #ae-hc :\0034Invalid Login:\003 $nick (Username: $user1)"        putcmdlog "$nick has failed to log in using $user1 as a username"        } else {        sql endquery $stuff        putserv "PRIVMSG #ae-hc :\0039Successful Login:\003 $nick (Username: $user1)"        putquick "invite $nick $chan_1"        putcmdlog "$nick has successfully logged in using $user1 as a username"        }}        sql disconnect $conn</code></pre></div>This is the new code however i now get the error message <br>[13:12] Tcl error [inv_1]: can't read "conn": no such variable<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Wed May 28, 2003 1:36 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-05-28T09:32:04-04:00</updated>

		<published>2003-05-28T09:32:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20867#p20867</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20867#p20867"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20867#p20867"><![CDATA[
hehe just remembered myself.. was gonna come back and make it right, but as usual you are here to show us the way <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Wed May 28, 2003 9:32 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-05-28T08:46:17-04:00</updated>

		<published>2003-05-28T08:46:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20858#p20858</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20858#p20858"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20858#p20858"><![CDATA[
<blockquote class="uncited"><div>just a couple of things,<br>2. Don't use the ' in the query, say if the pass is <em class="text-italics">sun</em>, then '$pass' would return <em class="text-italics">'sun'</em> not <em class="text-italics">sun</em> ... hope you see the difference <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> In TCL the ' char has no special meaning, and does not work like in php where it has the same use as "</div></blockquote>He has used this correctly.<br><br>It is not Tcl that needs the ' quote. It is MySQL.<br><div class="codebox"><p>Code: </p><pre><code>command hello and welcome to my world</code></pre></div>If the above where Tcl code, how would it tell that is all one string, or 6 seperate ones, hell, even 3 strings in random sized groups.<br><br>This is easy to fix in Tcl with ".<br><br>However, the same applies to MySQL. In Tcl &amp; PHP, you are using the SQL programming language within another language.<br><br>Just like in PHP and Tcl, MySQL distiguishes between what is part of a large string using quotes. In MySQL, you can use " and ' just like PHP.<br><br>His current usage with this is correct, for most compatability.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Wed May 28, 2003 8:46 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Papillon]]></name></author>
		<updated>2003-05-28T05:57:25-04:00</updated>

		<published>2003-05-28T05:57:25-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20847#p20847</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20847#p20847"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20847#p20847"><![CDATA[
just a couple of things,<br>1. You don't need the [] brackets around the sql query, nothing wrong, just thought I'd say it <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_wink.gif" width="15" height="15" alt=";)" title="Wink"><br>2. Don't use the ' in the query, say if the pass is <em class="text-italics">sun</em>, then '$pass' would return <em class="text-italics">'sun'</em> not <em class="text-italics">sun</em> ... hope you see the difference <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"> In TCL the ' char has no special meaning, and does not work like in php where it has the same use as "<br>3. Again nothing wrong, but no need to split the arg using " ", it'll default to that, all you need is <em class="text-italics">[split $arg]</em><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=852">Papillon</a> — Wed May 28, 2003 5:57 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-27T17:15:34-04:00</updated>

		<published>2003-05-27T17:15:34-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20806#p20806</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20806#p20806"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20806#p20806"><![CDATA[
right this is my new code<div class="codebox"><p>Code: </p><pre><code>load /sql/fbsql.sosql connect localhost ***** "*****"sql selectdb almightybind msg - login inv_1# Script starts nowproc inv_1 { nick uhost hand arg } {        global chan_1        set found 0        set arg [split $arg " "]        set user1 [lindex $arg 0]        set pass1 [lindex $arg 1]        [sql "SELECT * FROM tbl_member WHERE username = '$user1' password = '$pass'"]        if {[sql numrows] == 0} {        putserv "PRIVMSG $nick :Invalid password or username!"        putserv "PRIVMSG #ae-hc :\0034Invalid Login:\003 $nick (Username: $user1)"        putcmdlog "$nick has failed to log in using $user1 as a username"        } else {        putserv "PRIVMSG #ae-hc :\0039Successful Login:\003 $nick (Username: $user1)"        putquick "invite $nick $chan_1"        putcmdlog "$nick has successfully logged in using $user1 as a username"        }}</code></pre></div>however when i try and do /msg &lt;bot&gt; login &lt;nick&gt; &lt;pass&gt; it still doesnt work<br>ne ideas?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Tue May 27, 2003 5:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-05-27T17:11:46-04:00</updated>

		<published>2003-05-27T17:11:46-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20805#p20805</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20805#p20805"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20805#p20805"><![CDATA[
You keep the "lindex" commands, but not the "string range".<br><br>The "string range" commands are returning exactly what you put into them.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue May 27, 2003 5:11 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-27T11:29:00-04:00</updated>

		<published>2003-05-27T11:29:00-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20789#p20789</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20789#p20789"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20789#p20789"><![CDATA[
so u suggest i change the IF statement which ive now done, and also remove the string range commands?<br><br>Also if i remove the lindex commands where do i catch the username and password of the member?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Tue May 27, 2003 11:29 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[ppslim]]></name></author>
		<updated>2003-05-27T10:42:17-04:00</updated>

		<published>2003-05-27T10:42:17-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20784#p20784</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20784#p20784"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20784#p20784"><![CDATA[
OK, I noticed quite a few things after that<br><br>1: You don't need the "string range" commands. These simply return exactly what went in. I am guessing you are trying to account for the much covered list to string issues. "lindex" returns only one element, as such, this is a string (unless you have lists in lists, which is irelivent in this case).<br><br>2: Check your first IF statment. I am guessing is is meant to read<br><div class="codebox"><p>Code: </p><pre><code>if {[sql numrows] == 0} {ORif {![sql numrows]} {</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2">ppslim</a> — Tue May 27, 2003 10:42 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[almighty]]></name></author>
		<updated>2003-05-27T09:37:55-04:00</updated>

		<published>2003-05-27T09:37:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=20778#p20778</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=20778#p20778"/>
		<title type="html"><![CDATA[Problems with Invite MySQL script]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=20778#p20778"><![CDATA[
the sql server is on localhost<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2492">almighty</a> — Tue May 27, 2003 9:37 am</p><hr />
]]></content>
	</entry>
	</feed>
