hbradshaw has asked for the wisdom of the Perl Monks concerning the following question:
I'm writing a simple To-Do application in a way to learn Perl. The database table consists of three fields: time, status, and content.
I want to be able to see my items and to update a particular item at the same time. I am having trouble with the update portion of the script.
You can view the code in my scratchpad.
The script initially calls for subroutine show_item() which shows the item information. This subroutine shows two different methods of updating the item.
The first: submit (-name => "choice", -value => "Update") - applies the update to all the items, doesn't post to the database table and when you refresh the page the original information prior to the update appears. The update never occurred.
The second: " [", a ({-href => update_url}, "Update"), "]", doesn't apply the update and removes any information associated with that item except for the time. The update never occurred.
Here are the areas of the script that has update coded:
Any guidance or advice you can give will be greatly appreciated.elsif ($choice eq "update") sub update_item sub show_item
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with an update subroutine
by Coruscate (Sexton) on Jan 15, 2003 at 08:34 UTC | |
|
Re: Problem with an update subroutine
by tall_man (Parson) on Jan 15, 2003 at 01:09 UTC |