Re: unable to insert rows with php

From: "mike" <mike(at)partner2partner(dot)com>
To: pgsql-php(at)postgresql(dot)org
Subject: Re: unable to insert rows with php
Date: 2002-05-20 13:31:22
Message-ID: 20020520133122.26244.qmail@conan.partner2partner.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

ktt writes:
> printf ("ID : %s<br>\n", $row[0]);
> printf ("First Name: %s<br>\n", $row[1]);
> printf ("Surname : %s<br>\n", $row[2]);
> $query3 = "INSERT INTO friends (id, firstname,
> surname) values (nextval('friends_id_seq'),
> '$firstname', '$surname')";

You are not copying the values into the fields you are using in the INSERT
statement:

$firstname = $row[1];
$surname = $row[2];

Or

$query3 = "INSERT INTO friends (id, firstname, surname) values
(nextval('friends_id_seq'), '" . $row[1] . "', '" . $row[2] . "')";

Michael J. Upchurch
Partner2Partner Communications mike(at)partner2partner(dot)com 615.286.2199

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Keary Suska 2002-05-20 16:27:08 Re: unable to insert rows with php
Previous Message Duncan Adams (DNS) 2002-05-20 13:18:49 Re: unable to insert rows with php