X-Original-To: pgsql-php-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 517B13106C5 for ; Mon, 30 Jun 2003 16:16:59 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 03093-10 for ; Mon, 30 Jun 2003 13:16:48 -0300 (ADT) Received: from tomts21-srv.bellnexxia.net (tomts21.bellnexxia.net [209.226.175.183]) by svr1.postgresql.org (Postfix) with ESMTP id 70799310865 for ; Mon, 30 Jun 2003 13:16:48 -0300 (ADT) Received: from hwcn.org ([65.92.41.144]) by tomts21-srv.bellnexxia.net (InterMail vM.5.01.05.32 201-253-122-126-132-20030307) with ESMTP id <20030630161645.LOLP25826.tomts21-srv.bellnexxia.net@hwcn.org> for ; Mon, 30 Jun 2003 12:16:45 -0400 Date: Mon, 30 Jun 2003 12:16:46 -0400 Mime-Version: 1.0 (Apple Message framework v552) Content-Type: text/plain; charset=US-ASCII; format=flowed Subject: PHP form Creates Blank DB entries From: Michael Hanna To: pgsql-php@postgresql.org Content-Transfer-Encoding: quoted-printable Message-Id: <3EC8256A-AB16-11D7-8634-00039308EB2C@hwcn.org> X-Mailer: Apple Mail (2.552) X-Archive-Number: 200306/38 X-Sequence-Number: 2102 I can post with this code, however the result is a new row in the=20 table, where each column is blank except for the serial number. Any=20 ideas? PG 7.3.3, PHP 4.3.0 it can be tested at : http://www.siddha.ca/healthnotes/add.php view the addressbook table at: http://www.siddha.ca/healthnotes/index.php Michael ----- Untitled Document

Address Book

" method=3D"POST"> Name:

Address:

Tel:

Email:

"; $pass =3D ""; $db =3D "test"; // open a connection to the database server $connection =3D pg_connect("host=3D$host dbname=3D$db user=3D$user password=3D$pass"); if (!$connection) { die("Could not open connection to database server"); } // error checks on form submission go here // generate and execute a query $query =3D "INSERT INTO addressbook VALUES (nextval('addressbook_id_seq'), '$name', '$address', '$tel', '$email')"; $result =3D pg_query($connection, $query) or die("Error in query: $query. " . pg_last_error($connection)); echo "Data successfully added."; // close database connection pg_close($connection); } ?>