"J. c. B." <[EMAIL PROTECTED]> writes:
> On the page examples.ttml it says "You can, if everything is
> compiled right, load tcl modules, like libpgtcl.so (the Postgresql
> interface), so that you can interact with a database!"
> Does anyone know how to do this?
Just like you would do in a regular Tcl application!
> I have mod_dtcl installed correctly as a static install. I have
> tested it and Tcl pages work. I put "LoadModule libpgtcl_module
> /usr/local/pgsql/lib/libpgtcl.so" in the httpd.conf file
Yikes! You are trying to load it as an Apache module - that isn't
going to work:-) It is a module for Tcl, after all.
> Question 2:
> Once I get the module loaded right does anyone have some code of a
> simple postgres "get pool" and a simple select statement from a ttml
> page?
You should put something in the ChildInitScript.
I do something like this:
proc getcheckconnect { } {
if { ! [ info exists ::globalconn ] } {
set ::globalconn [ pg_connect $::dbname ]
}
return $::globalconn
}
then in my pages, I can do
set conn [getcheckconnect]
This could probably be made more elaborate...
An example of a select?
set conn [ getcheckconnect ]
set res [ pg_exec $conn "select * from $field" ]
pg_result $res -assign categories
puts {<select name="$field">}
foreach {name val} [array get categories "*,name"] {
puts "<option>$val</option>\n"
}
hputs {</select>}
is somethign I found in my own code
> I also see that the mailing lists are no longer being hosted.
Err... the mailing list is being hosted just fine. What I want is to
get them (the apache tcl lists) archived on the web.
> do you guys need in order to get the mailing list up? I'm excited
> about the mod_dtcl project. Mod_dtcl is already faster than
> Aolserver serving simple tcl-html pages! I'm excited to test
> mod_dtcl with database interaction.
Cool:-)
--
David N. Welton
Consulting: http://www.dedasys.com/
Free Software: http://people.debian.org/~davidw/
Apache Tcl: http://tcl.apache.org/
Personal: http://www.efn.org/~davidw/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]