Re: Web Tools - Mailing list pgsql-general

From J J
Subject Re: Web Tools
Date
Msg-id 370E3A18.2F302134@hotmail.com
Whole thread Raw
In response to Web Tools  ("Ronald L. Chichester" <complaw@hal-pc.org>)
List pgsql-general
Ronald L. Chichester wrote:

> Hi:
>
> I want to use PostgreSQL as a database engine for a web-based intranet
> (using Apache on Linux).  Is there a repository of CGI examples that I
> could use, or are there some software tools that could take out some of
> the time and grunt work?
>
> Thanks in advance,
>
> Ron Chichester

This uses the built in "print a HTML table row" function:

#!/usr/bin/perl -w

use Pg;
use CGI;

$wp = new CGI;

$custname = uc $wp->param('custname');
print $wp->header;
print $wp->start_html(-author=>"jj");

$conn = Pg::connectdb("dbname = john");
if ($conn->status != PGRES_CONNECTION_OK) {
        die("Can't connect");
}

$res = $conn->exec("select * from workorder where name like
'%$custname%'");
#fout, header, align, standard, html3, expanded, pager, fieldSep,
tableOpt, caption, ...
$res->print (STDOUT, "", "", 0, 1, 0, 0, "|", "border=1", "Customers");

print $wp->end_html;



pgsql-general by date:

Previous
From: Mauro Bartolomeoli
Date:
Subject: ERROR: ExecInitIndexScan
Next
From: J J
Date:
Subject: Re: Postgresql Access with Perl and DBD::PG