First, you have to install something to allow tcl to play with sql databases.
In my mind, the most powerful and easy is fbsql :
http://www.fastbase.co.nz/fbsql/index.html
---
Secondly, you have to create a table with two columns : one for the timestamp (for example called
datetime), another for the text (for exemple called
text)
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 ?
---
Finally, the scripts.
To initialize fbsql :
To insert a text in database, one line is enough :
Code: Select all
sql "INSERT INTO theNameOfYourTable (datetime, text) VALUES ('[unixtime]', '$text')" where $text is a parameter of the proc.
Finally, to read ALL the text (it's possible to filter) :
Code: Select all
#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 timestamp
set timestamp [strftime "%d/%m %R" [lindex $text 0]]
putdcc $idx "<$timestamp> [lindex $text 1]"
}