Can't save edited values to database
From: Nancy McMullin (NANCY.MCMULLIN_at_DFAS.MIL)
Date: 02/18/05
- Next message: Alan Kong: "RE: Can't save edited values to database"
- Previous message: Jon Lapham: "elegent way to handle "pluggable" backend servers?"
- Next in thread: Alan Kong: "RE: Can't save edited values to database"
- Maybe reply: Alan Kong: "RE: Can't save edited values to database"
- Maybe reply: Todd E \ Odell: "RE: Can't save edited values to database"
- Reply: Kevin Carothers: "Re: Can't save edited values to database"
- Reply: Michael A Chase: "Re: Can't save edited values to database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 18 Feb 2005 09:21:27 -0700 To: <dbi-users@perl.org>
I'm attempting an edit screen in Perl with Oracle. I'm unable to figure
out how to keep the changed values so I can write to the DB. Can
anyone help? Here's part of my code:
===================
....
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
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";
my $notes = $pnotes;
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.
...
===================
Thanks!
- Next message: Alan Kong: "RE: Can't save edited values to database"
- Previous message: Jon Lapham: "elegent way to handle "pluggable" backend servers?"
- Next in thread: Alan Kong: "RE: Can't save edited values to database"
- Maybe reply: Alan Kong: "RE: Can't save edited values to database"
- Maybe reply: Todd E \ Odell: "RE: Can't save edited values to database"
- Reply: Kevin Carothers: "Re: Can't save edited values to database"
- Reply: Michael A Chase: "Re: Can't save edited values to database"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|