Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

tcl/tk programming to a database

Posted on 2009-04-05
6
Medium Priority
?
766 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 1500 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It is becoming increasingly popular to have a front-page slider on a web site. Nearly every TV website,  magazine or online news has one on their site, and even some e-commerce sites have one. Today you can use sliders with Joomla, WordPress or …
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

824 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