Solved

tcl/tk programming to a database

Posted on 2009-04-05
6
719 Views
Last Modified: 2013-11-22
I am writing a very simple piece of software in TCL/TK under the linux environment and want to store the data in a database. I have never written any software to interact with a database so this is a first for me. I need to know what databases I can use with TCL/TK and which would interact best with what I want to do if I have multiple choices. I would like to stress that I have never dealt with databases ever before. If there is a tutorial with example code that would be great start. Any and all help will be appreciated.
0
Comment
Question by:georgopanos
  • 3
  • 2
6 Comments
 
LVL 24

Accepted Solution

by:
fridom earned 500 total points
ID: 24074678
In short you can probably use any Database you can get your hands on.

See e.g
http://dev.mysql.com/doc/refman/5.1/de/tcl.html
http://wiki.tcl.tk/10548
http://wiki.tcl.tk/6193

And well if there is not a direct TCL binding there will be some C binding  and you can use any C writen stuff very easily with tcl.

Regards
Friedrich
0
 

Author Comment

by:georgopanos
ID: 24093078
This was a very good start but since I have never worked with databases before it is a little difficult to understand. Is there any concrete code that is a simple database program written in TCL that uses MySQL so I can read the code and understand the interaction between the database and TCL code?
0
 
LVL 15

Expert Comment

by:mish33
ID: 24093658
See http://wiki.tcl.tk/13201

As an example (from http://wiki.tcl.tk/6051):
 package require mysqltcl
 set m [mysqlconnect -user root -db mysql -password foobar]
 mysqluse $m mysql
 foreach res [mysqlsel $m {select host from user} -flatlist] {
     puts $res
 }
 mysqlclose $m

Open in new window

0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 24

Expert Comment

by:fridom
ID: 24094082
There are tons of examples e.g in Openacs codebase, it even connects that with
HTML rendering. There is one exceptional book available which just discusses that. It's named
Philip and Alex's Guide to Web Publishing.

Regards
Friedrich
0
 

Author Comment

by:georgopanos
ID: 24122248
Thank you fridom for your help the combination of those pages and a blip from Professional Linux Programming from Jon Masters helped  quite a bit. I have not completed a program to communicate with the mySQL DBASE yet.
0
 
LVL 24

Expert Comment

by:fridom
ID: 24154746
Have you tried
http://www.xdobry.de/mysqltcl/

?

Regards
Friedrich
0

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question