Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id C94A9475D3C for ; Mon, 20 May 2002 09:19:01 -0400 (EDT) Received: from vodabemail2.vodacom.co.za (vodabemail2.vodacom.co.za [196.6.129.90]) by postgresql.org (Postfix) with ESMTP id 4FA9A475D39 for ; Mon, 20 May 2002 09:18:58 -0400 (EDT) Received: by vodabemail2.vodacom.co.za with Internet Mail Service (5.5.2653.19) id ; Mon, 20 May 2002 15:14:43 +0200 Message-ID: <7DD34E6DF5CD1B4283DDAB96A855DCED2F334F@vodabemail1.vodacom.co.za> From: "Duncan Adams (DNS)" To: pgsql-php@postgresql.org Subject: Re: unable to insert rows with php Date: Mon, 20 May 2002 15:18:49 +0200 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Archive-Number: 200205/77 X-Sequence-Number: 1209 $query3 = "INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'), '$firstname', '$surname')"; where do u get the values for $firstname and $surname should that not be $row[1] and row[2] -----Original Message----- From: ktt [mailto:kestutis98@yahoo.com] Sent: Monday, May 20, 2002 2:04 PM To: angelo.rigo@globo.com Cc: pgsql-php@postgresql.org Subject: Re: [PHP] unable to insert rows with php --- angelo.rigo@globo.com wrote: > Can you show your code ? yes. it's written for test. ------ \n", $row[0]); printf ("First Name: %s
\n", $row[1]); printf ("Surname : %s
\n", $row[2]); $query3 = "INSERT INTO friends (id, firstname, surname) values (nextval('friends_id_seq'), '$firstname', '$surname')"; $result = pg_exec($db, $query3); if (!$result) { printf ("ERROR"); $errormessage = pg_errormessage($db); echo $errormessage; exit; } pg_close(); printf ("These values were inserted into the database - %s %s", $firstname, $surname); echo"
"; echo "First Name : "; echo "
Surname : "; echo "
"; echo "
"; ?> > -- Mensagem Original -- > > > > >Hello, > > > >I'm trying to insert data in the table, using PHP > >interface, but script creates an empty > >row without data. > >If you had similar problem, please, suggest > >a solution. > >I'm using Debian potato, PostgreSQL 7.2, > >Apache 1.3.24. > > > >Thank you in advance, > > > >ktt > > > > > > > > > >__________________________________________________ > >Do You Yahoo!? > >LAUNCH - Your Yahoo! Music Experience > >http://launch.yahoo.com > > > >---------------------------(end of > broadcast)--------------------------- > >TIP 2: you can get off all lists at once with the > unregister command > > (send "unregister YourEmailAddressHere" to > majordomo@postgresql.org) > > > > > > > ________________________________________ > A busca mais veloz e precisa da internet. Acesse > agora: http://www.zoom.com.br. > __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org