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

	<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>2004-11-07T18:57:15-04:00</updated>

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

		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-11-07T18:57:15-04:00</updated>

		<published>2004-11-07T18:57:15-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=42565#p42565</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=42565#p42565"/>
		<title type="html"><![CDATA[Back At it again]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=42565#p42565"><![CDATA[
after putting this stupid thing down for months, I'm trying again.  Now from all my prvious posts I'm trying to retrive information and add information into a mysql database. using pub commands, my old code looks like this, someone let me know wtf I'm doing wrong here.<div class="codebox"><p>Code: </p><pre><code>#Adding Routineproc add:pub {nick uhost handle channel arg} {global mysql netset arg [rls:filter $arg]set table $mysql(release_table)set sql(conn) [mysqlconnect -host $mysql(host) -user $mysql(user) -password $mysql(pass)]mysqluse $sql(conn) $mysql(data)mysqlexec $sql(conn) "INSERT INTO '$table' ( 'id' , 'release_data' , 'release_date' ) VALUES ( '', $arg' , NOW( ))"mysqlclose $sql(conn)pustserv "NOTICE $nick :Release has been added"putcmdlog "&lt;&lt;$nick&gt;&gt; !$handle! Added a new Release to the database."}#Deleting Routinebind pub - !del del:pubproc del:pub {nick uhost handle channel arg} {global mysql netset table $mysql(release_table)set id ""set sql(conn) [mysqlconnect -host $mysql(host) -user $mysql(user) -password $mysql(pass)]mysqluse $sql(conn) $mysq(data)if {[string is integer $arg]} {set id [lindex [lindex [mysqlsel $sql(conn) "SELECT * FROM `$table` ORDER BY id ASC LIMIT [expr $arg -1],1;" -list] 0] 0]} elseif {[lindex $arg 0] == "-id" &amp;&amp; [string is integer [lindex $arg 1]]} {set id [lindex $arg 1]}if {$id != ""} { set result [mysqlexec $sql(conn) "DELETE FROM `$table` WHERE `id` = '$id'"] }mysqlclose $sql(conn)if {$result != 0} {putserv "PRIVMSG $channel :Release has been deleted"putcmdlog "&lt;&lt;$nick&gt;&gt; !$handle! Deleted a Release in $channel."} else {putserv "PRIVMSG $channel :No such Release in database"}}</code></pre></div>now i'm also trying to add a search string to allow to search for more than 10 but i also only want displayed the first 10 releases. here is that code<br><div class="codebox"><p>Code: </p><pre><code>proc rls_show {nick uhost hand chan arg} {global mysql netset sql(conn) [mysqlconnect -host $mysql(host) -user $mysql(user) -password $mysql(pass)]mysqluse $sql(conn)mysqlsel $mysql(data) "SELECT id, release_data, release_date FROM $mysql(table)" -listputserv "PRIVMSG $nick :The Following is the 10 Newest Releases by \002blah\002"putserv "PRIVMSG $nick :Title:$release_data Date:$release_date"putserv "PRIVMSG $nick :TO search for more releases use !new #, or !new all"</code></pre></div>I need to know what I'm doing wrong so I can start to fix this stupid problem.  I'm open to all suggestions you have.. thanks<br><br><br>Also on the announcing part of the serach I get each line over and over like this <br>blah blah bhla<br>1.<br>blah blah blah<br>blahblahblah<br>2.<br>blah blah blha<br><br>instead of <br>blah blah blah <br>1.<br>2.<br>3.<br>blha blha blha<br><br>Thanks for any help<br><br><br>Smokey[/code]<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Sun Nov 07, 2004 6:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-07-06T00:00:22-04:00</updated>

		<published>2004-07-06T00:00:22-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=38248#p38248</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=38248#p38248"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=38248#p38248"><![CDATA[
could u xplain what that is supposed to be ? and how did u make the country thing looks kinda cool was looking for something like it for my website tnx in advance<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Tue Jul 06, 2004 12:00 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-06-24T14:30:59-04:00</updated>

		<published>2004-06-24T14:30:59-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=37812#p37812</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=37812#p37812"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=37812#p37812"><![CDATA[
its been awhile since I was last on the net... my net time is starting to get smaller and smaller.. well anyways.. I beleive what I meant as a header and footer was.<br><br>New releases by Blah<br>1.<br>2.<br>3.<br>4.<br>checks us out on the web at <a href="http://www.blah.com" class="postlink">http://www.blah.com</a><br><br>instead it was doing the top and bottom half over and over with each posting of the list.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Thu Jun 24, 2004 2:30 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-04-11T12:55:27-04:00</updated>

		<published>2004-04-11T12:55:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35429#p35429</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35429#p35429"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35429#p35429"><![CDATA[
what header i mean header of what ? .. what do you mean <br><br>hmm normal<br><blockquote class="uncited"><div>puts header<br><br>while ...<br>puts list ...<br>close ...<br><br>puts footer</div></blockquote><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sun Apr 11, 2004 12:55 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-04-10T22:49:13-04:00</updated>

		<published>2004-04-10T22:49:13-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35407#p35407</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35407#p35407"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35407#p35407"><![CDATA[
okay well it works somewhat... now if I can get the header and the footer to display once, then show the list.... that's the problem I tried a older method, but it started to give me tcl errors.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Sat Apr 10, 2004 10:49 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-04-10T05:31:27-04:00</updated>

		<published>2004-04-10T05:31:27-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35389#p35389</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35389#p35389"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35389#p35389"><![CDATA[
split up the date just use one string like unix time and use clock format unix time is all decimal chars and u can use it in php as well if you wana use webbased [censored] afterwards unixtime is almost reconized in any code so you can format anything from that way beter then spliting dates and [censored]<br><br>But this is totaly up to you<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Sat Apr 10, 2004 5:31 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-04-09T18:44:54-04:00</updated>

		<published>2004-04-09T18:44:54-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35384#p35384</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35384#p35384"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35384#p35384"><![CDATA[
okay I can list the db somewhat, though I would like to create a header and a footer, seems that might be the only way... also i tired to split it up in 3 ways like Ttle: Data: Date:, and I justed [join [lrange $qurey 1]] but it says its needs a end, i don't remember how to stop it at just that filed so i can display the date information on another line..<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Fri Apr 09, 2004 6:44 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-04-09T00:05:26-04:00</updated>

		<published>2004-04-09T00:05:26-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35345#p35345</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35345#p35345"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35345#p35345"><![CDATA[
Limit is a mysql statement right then hmm u need to check the Mysql reference also if your making a search script also check LIKE<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Fri Apr 09, 2004 12:05 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-04-08T18:57:11-04:00</updated>

		<published>2004-04-08T18:57:11-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35340#p35340</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35340#p35340"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35340#p35340"><![CDATA[
okay I got it setup working with adding, now I have to see if I can get delete working, and then the searching funtion.<br><br>now with the serach i can just use -limit 10 for it to display the first 10 results, but then would it be better to use a switch or, a else if statment to use for another string ? like !list 99 or something ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Thu Apr 08, 2004 6:57 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-04-08T16:25:21-04:00</updated>

		<published>2004-04-08T16:25:21-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35328#p35328</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35328#p35328"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35328#p35328"><![CDATA[
do not set the field to date time set it to decimal or int<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Apr 08, 2004 4:25 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-04-08T16:20:52-04:00</updated>

		<published>2004-04-08T16:20:52-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35327#p35327</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35327#p35327"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35327#p35327"><![CDATA[
well I've build this proc, using mc_8's strip proc and the regsub filter, in hopes this might work, from what I was reading you can set a field in mysql to "datetime", not sure if this is true, i'm going to try it and find out. But this proc might work, if everything else is true<br><br>proc add:pub {nick ushost handle channel arg} {<br>global mysql net<br>set arg [rls:filter $arg]<br>set table $mysql(release_table)<br>set sql(conn) [mysqlconnect -host $mysql(host) -user $mysql(user) -password $mysql(pass)]<br>mysqluse $sql(conn) $mysql(data)<br>mysqlexec $sql(conn) "INSERT INTO '$table' ( 'id' , 'release_data' , 'release_date' ) VALUES ( '', $arg' , NOW( ))"<br>mysqlclose $sql(conn)<br>pustserv "NOTICE $nick :Release has been added"<br>putcmdlog "&lt;&lt;$nick&gt;&gt; !$handle! Added a new Release to the database."<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Thu Apr 08, 2004 4:20 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-04-08T16:15:55-04:00</updated>

		<published>2004-04-08T16:15:55-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35325#p35325</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35325#p35325"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35325#p35325"><![CDATA[
so what your saying is using the string map to something like this correct ?<br><br>string map {\003?? \000 \017 \026} $arg<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Thu Apr 08, 2004 4:15 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-04-08T15:43:04-04:00</updated>

		<published>2004-04-08T15:43:04-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35321#p35321</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35321#p35321"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35321#p35321"><![CDATA[
<blockquote class="uncited"><div>i found this in MC_8's moretools.tcl<br><br>proc mirc_strip {{args ""}} {<br>set switches ""<br>if {$switches == ""} {set switches all}<br>set arg [lindex $args 0]<br>set all [expr {([lsearch -exact $switches all] &gt;= 0) ? 1 : 0}]<br>set list [list \002 "" \017 "" \026 "" \037 ""]<br>regsub -all -- "\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $arg "" arg<br>set arg [replace -- $arg [join $list]]<br>return $arg<br>}<br><br>I'm going to guess. this would work? or would it cause more problems if the code is a bit outdated ?</div></blockquote>no what i use is string map this is different from regsub see i prefer to use string map but u could do that above altho string map is faster but i gues it would work just fine tho <br><br>this is a complete solution mine is just a sample string<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Apr 08, 2004 3:43 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Ofloo]]></name></author>
		<updated>2004-04-08T15:39:29-04:00</updated>

		<published>2004-04-08T15:39:29-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35320#p35320</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35320#p35320"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35320#p35320"><![CDATA[
no check <a href="http://www.tcl.tk/man/tcl8.3/TclCmd/clock.htm" class="postlink">clock</a> this also if ur inserting it to a db its beter like this. <br><br>check clock format and clock seconds<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=3151">Ofloo</a> — Thu Apr 08, 2004 3:39 pm</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[SmokeyOne]]></name></author>
		<updated>2004-04-08T15:36:14-04:00</updated>

		<published>2004-04-08T15:36:14-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=35319#p35319</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=35319#p35319"/>
		<title type="html"><![CDATA[Mysql: adding to a database]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=35319#p35319"><![CDATA[
i found this in MC_8's moretools.tcl<br><br>proc mirc_strip {{args ""}} {<br>set switches ""<br>if {$switches == ""} {set switches all}<br>set arg [lindex $args 0]<br>set all [expr {([lsearch -exact $switches all] &gt;= 0) ? 1 : 0}]<br>set list [list \002 "" \017 "" \026 "" \037 ""]<br>regsub -all -- "\003(\[0-9\]\[0-9\]?(,\[0-9\]\[0-9\]?)?)?" $arg "" arg<br>set arg [replace -- $arg [join $list]]<br>return $arg<br>}<br><br>I'm going to guess. this would work? or would it cause more problems if the code is a bit outdated ?<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=2530">SmokeyOne</a> — Thu Apr 08, 2004 3:36 pm</p><hr />
]]></content>
	</entry>
	</feed>
