error in code - Mailing list pgsql-admin

From Ashok Chauhan
Subject error in code
Date
Msg-id 1071033961.1264.7.camel@chi
Whole thread Raw
List pgsql-admin
****************************
# include <stdio.h>
# include <stdlib.h>
# include <libpq-fe.h>

int main()
{
        PGresult *result;
        PGconn *conn;
        int feild;
        printf("successful");
        conn = PQconnectdb ("ashok");
        result = PQexec (conn, "select * from bill");
        feild = PQntuples (result);
        printf("%d",feild);
        PQclear (result);
        PQfinish (conn);
        printf("hello");
        return 1;


}

I written a code and compile with following command, it complied and
create 'a.out' file but when i run the a.out it give nothing.
command:- "gcc program.c -I /usr/include/pgsql/include -L
/usr/lib/libpq.a -lpq"

plz help me.
Ashok

pgsql-admin by date:

Previous
From: "Uwe C. Schroeder"
Date:
Subject: Re: Running Postgres Daemons with same data files
Next
From: Sai Hertz And Control Systems
Date:
Subject: Re: Upgrading from 7.2.4 (RH 8) to 7.4 (RH9)