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

	<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-07-14T10:26:30-04:00</updated>

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

		<entry>
		<author><name><![CDATA[Dereckson]]></name></author>
		<updated>2003-07-14T10:26:30-04:00</updated>

		<published>2003-07-14T10:26:30-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23464#p23464</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23464#p23464"/>
		<title type="html"><![CDATA[Pls help me with sql in tcl ...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23464#p23464"><![CDATA[
First, you have to install something to allow tcl to play with sql databases.<br><br>In my mind, the most powerful and easy is fbsql : <a href="http://www.fastbase.co.nz/fbsql/index.html" class="postlink">http://www.fastbase.co.nz/fbsql/index.html</a><br><br>---<br><br>Secondly, you have to create a table with two columns : one for the timestamp (for example called <span style="text-decoration:underline">datetime</span>), another for the text (for exemple called <span style="text-decoration:underline">text</span>)<br><br>Do you have phpMyAdmin on the server you use or do you need explanations to use mysql directly from a shell or is it installed on your personnal computer ?<br><br>---<br><br>Finally, the scripts.<br><br>To initialize fbsql :<div class="codebox"><p>Code: </p><pre><code>load ./fbsql.so</code></pre></div>To insert a text in database, one line is enough :<div class="codebox"><p>Code: </p><pre><code>sql "INSERT INTO theNameOfYourTable (datetime, text) VALUES ('[unixtime]', '$text')" where $text is a parameter of the proc.</code></pre></div>Finally, to read ALL the text (it's possible to filter) :<div class="codebox"><p>Code: </p><pre><code>#First, create a list with all the rows :set allText [sql "SELECT datetime, text FROM theNameOfYourTable"]#Then, print each row :foreach text $allText {#text is a list with one element per row#Read the timestampset timestamp [strftime "%d/%m %R" [lindex $text 0]]putdcc $idx "&lt;$timestamp&gt; [lindex $text 1]"}</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=1339">Dereckson</a> — Mon Jul 14, 2003 10:26 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[Anonymous]]></name></author>
		<updated>2003-07-14T09:44:56-04:00</updated>

		<published>2003-07-14T09:44:56-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=23463#p23463</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=23463#p23463"/>
		<title type="html"><![CDATA[Pls help me with sql in tcl ...]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=23463#p23463"><![CDATA[
Hello mates...<br><br>I really dont have any knowledge of SQL ... in TCL i already can do many things... but sql is like a book with 7 seals ...<br><br>I want to grab a text, insert that in a sql-database with date and time, and i want to be able to read this text and see the date and time ...<br><br>Something like a "pre-time-logger" ... hope you can help me <img class="smilies" src="https://forum.eggheads.org/images/smilies/icon_smile.gif" width="15" height="15" alt=":)" title="Smile"><p>Statistics: Posted by Guest — Mon Jul 14, 2003 9:44 am</p><hr />
]]></content>
	</entry>
	</feed>
