Re: unable to insert rows with php - Mailing list pgsql-php

From mike
Subject Re: unable to insert rows with php
Date
Msg-id 20020520133122.26244.qmail@conan.partner2partner.org
Whole thread Raw
In response to Re: unable to insert rows with php  (ktt <kestutis98@yahoo.com>)
List 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@partner2partner.com  615.286.2199


pgsql-php by date:

Previous
From: ktt
Date:
Subject: Re: unable to insert rows with php
Next
From: "Duncan Adams (DNS)"
Date:
Subject: Re: unable to insert rows with php