ie: I do a query on a Pg db and then name several iterations of a form as [fieldname]'. $row . '
My problem is how do I use this in the submit form
If I do CASE statements quoting eg id1 id2 id3 then my update works
My question is is it possible to do this by referring to eg id.$row .' ie how the names are defined in the previous form
This is my current code
Code: Select all
<?php
$db = pg_connect("dbname=data_cc");
$id_chg=$_POST("id'. $row .'");
$firstchg=$_POST("$firstname'. $row .'");
$query = "UPDATE tb_contacts SET first_name='$firstchg' WHERE contact_id='$id_chg'";
$result = pg_exec($db, $query);
if (!$result) {
printf ("ERROR");
$errormessage = pg_errormessage($db);
echo $errormessage;
exit;
}
printf ("These values were updated in the database - ");
pg_close();
?>PHP Notice: Array to string conversion in /home/www/html/update1.php on line 3
PHP Fatal error: Call to undefined function: array() in /home/www/html/update1.php on line 3
Content-type: text/html
X-Powered-By: PHP/4.3.4