Nancy,
You might try something like below. Since getting the results to the
client and updating are separate requests.


If(param('SAVE CHANGES')) {
  &updateNotes();
} else {
  &displayNotes();
}

Sub displayNotes() {
>my $pt  = param('t1');  # value retrieved from page before
>...
>my $dbh = DBI->connect("DBI:Oracle:sid", "uid", "pw",{AutoCommit=>1});
>
>($pnotes) = $dbh->selectrow_array("SELECT notes FROM table WHERE t1 =
>'$pt'");
>...
>Print "<form>";
>print "<input type=text value=\"$pnotes\" name=notes>\n"; #user enters
>new value here

Remember to pass the t1 value as well.
<hidden value=$pt name="t1">  # or something like that

>print "<input type=submit name=edit value=' SAVE CHANGES '>\n"; # don't
>know what to use to actually start the update statement below...
>print "</form>\n";

} #end diplayNotes
      
Sub updateNotes() {
My $pt = param('t1');
My $notes = param('notes');

>my $sth = $dbh1->prepare("UPDATE table SET notes='$notes' WHERE t =
>'$pt'") or die "Preparing: ", $dbh->errstr;
>$sth->execute or die "Executing: ", $sth->errstr;  # this is just
>writing out the old values - not the new changes.
>...
 
} #end update Notes

Reply via email to