Hi there
I have a form that writes the values into an existing database. Works fine when you would like to create new rows.
But now I want the form to write the values into existing rows.
All the necessary fields are set.
In my autogenerated code I have the following
What should I add?
I have a form that writes the values into an existing database. Works fine when you would like to create new rows.
But now I want the form to write the values into existing rows.
All the necessary fields are set.
In my autogenerated code I have the following
<?php
global $database;
srand((double)microtime()*10000);
$inum = "I" . substr(base64_encode(md5(rand())), 0, 16);
$database->setQuery( "INSERT INTO #__chronoforms1 VALUES
('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '".mosGetParam($_POST,'A','')."', '".mosGetParam($_POST,'B','')."', '".mosGetParam($_POST,'C ','')."', '', '".mosGetParam($_POST,'D','')."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
I would like the form to write away A, B, C and D but D has to equal the existing field IDWhat should I add?