From: Jeff <jklcom@mindspring.com>
To: pgsql-interfaces@postgresql.org
Subject: CGI Error
Date: Thu, 22 Feb 2001 20:48:35 -0500
Message-ID: <974g2q$s9f$1@news.tht.net> (raw)
I'm getting this when access the cgi:
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:
Here's the cgi code:
int main()
{
printf("Content-Type: %s\n\n", contentType);
conn = PQconnectdb("dbname=template1");
if (PQstatus(conn) == CONNECTION_BAD)
{
printf("Connection to database failed.\n");
printf("%s", PQerrorMessage(conn));
return(1);
}
strcpy(query_string,
"SELECT * FROM cities");
res = PQexec(conn, query_string);
if (PQresultStatus(res) != PGRES_TUPLES_OK)
{
printf("SELECT query failed.\n");
PQclear(res);
PQfinish(conn);
return(1);
}
for (i = 0; i < PQntuples(res); i++)
printf("%s\n", PQgetvalue(res, i, 0));
PQclear(res);
PQfinish(conn);
return(0);
}
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: jklcom@mindspring.com
Subject: Re: CGI Error
In-Reply-To: <974g2q$s9f$1@news.tht.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox