| From: | "Jeff" <jklcom(at)mindspring(dot)com> | 
|---|---|
| To: | pgsql-interfaces(at)postgresql(dot)org | 
| Subject: | CGI Error | 
| Date: | 2001-02-23 01:48:35 | 
| Message-ID: | 974g2q$s9f$1@news.tht.net | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-interfaces | 
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);
}
| From | Date | Subject | |
|---|---|---|---|
| Next Message | He Weiping(Laser Henry) | 2001-02-23 03:14:12 | Re: [HACKERS] Re: [INTERFACES] Re: Chinese patch for Pgaccess | 
| Previous Message | Bruce Momjian | 2001-02-23 01:21:11 | Re: [INTERFACES] Re: Chinese patch for Pgaccess |