Received: from relay14.jaring.my (relay14.jaring.my [192.228.128.125]) by hub.org (8.9.2/8.9.1) with ESMTP id WAA21227 for ; Fri, 5 Feb 1999 22:06:02 -0500 (EST) (envelope-from hoelc@pd.jaring.my) Received: from pd.jaring.my (j31.sja.jaring.my [161.142.117.225]) by relay14.jaring.my (8.8.8/8.8.7) with ESMTP id LAA29424 for ; Sat, 6 Feb 1999 11:05:29 +0800 (MYT) Message-ID: <36BBB16D.F0F88A26@pd.jaring.my> Date: Sat, 06 Feb 1999 11:05:18 +0800 From: hoelc Reply-To: hoelc@pd.jaring.my X-Mailer: Mozilla 4.05 [en] (Win95; I) MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: question on accessing PostgreSQL with C Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, I'm a newbee in PostgreSQL, Linux world. Currently facing some problem in building a simple application. I'm trying to write a C program that get input from user, then update (insert / change) the database, or retrieve selected data. Questions: (1) Where to get more example of communicating with PostgreSQL with C program? (2) How to put variables into the SQL? I use C program to access PostgreSQL with libpq, and use PQexec( ) to send the query. One of the failed example of mine, : /* get input from user, a string and an integer */ : PQexec(conn,"insert into NameList (name,id) values (%s,%d) ....... : /* I'm trying to put variables of string and integer into the query */ (3) How to check who are the users in PostgreSQL system? Please advise. Thanks & Regards, LCH