Re: unable to insert rows with php

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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@xxxxxxxxxxxxxxxxxxx 615.286.2199


[Index of Archives]     [Postgresql General]     [Postgresql Admin]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Yosemite Backpacking]     [Postgresql Jobs]

  Powered by Linux