Re: Presenting PGAccess Pages to the WWW.

From: Jacques Williams <jacques(at)jacqro(dot)com>
To: David Lloyd-Jones <david(dot)lloyd-jones(at)attcanada(dot)ca>
Cc: pgsql-novice(at)hub(dot)org
Subject: Re: Presenting PGAccess Pages to the WWW.
Date: 2000-08-01 13:26:09
Message-ID: 20000801092609.A38872@jacqro.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

David,

If you haven't already, take a look at OpenACS (http://www.openacs.org).

Basically, the way you do this is to load the Postgresql driver for AOLserver,
and use the ns_db commands to connect to the database. Even if you don't want to use the OpenACS package (it's quite large, and may be more than you need), there is a file of utility tcl functions which will make coding this a lot easier.

For example, if I want to do a SELECT query and load it into a <ul> on a web page, I could do it something like this:

set db [ns_db gethandle]
set my_query "select field1, field2 from my_table"
set return_string "<ul>\n"
set selection [ns_db select $db $my_query]
while { [ns_db getrow $db $selection] } {
set_variables_after_query
append return_string "<li>$field1, $field2\n"
}

HTH,

Jacques Williams

On Mon, Jul 31, 2000 at 08:03:52PM -0400, David Lloyd-Jones wrote:
> I need to present the contents of a Postgresql database (the results of
> SELECT and other commands) to a Web Browser page as presented by AOLserver.
>
> Last night I made a number of good forms with your gerat software, but at
> the end of it all they seemed to be in the form of tables within a database.
> My question is: where are these to be found in the form of .tcl files?
>
> If they exist as .tcl files, can I then export them as data, to be included
> in .adp or .asp (like .html) browser pages?
>
> * * *
>
> If this is not possible, what is the best format for presenting the results
> of SQL queries to the WWW?
>
> -dlj.
>
>
>
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message David Willey 2000-08-01 15:10:22 NOVICE - Wildcard query
Previous Message David Lloyd-Jones 2000-08-01 00:43:29 Editing Input Errors in PSQL