in reply to Tracking records to change/insert during CGI
As for the second problem, you may want to change your db design to either use timestamps (if your database allows, like MySQL) which will UPDATE every time you update a record but NOT when someone reads from it. You can check to see if the timestamp in the current record is greater than the one being updated by the form's fields. If it is, you know that the record was changed in some way.
BTW, if your database doesn't keep track of time in the timestamp down to the millisecond you may want to use a module like Time::HiRes to create the timestamp and convert the DB table to a string type.
Here's an article which discusses the problem in a different language and suggests you use GUIDs (which I think you can do in Perl too. Check CPAN).
Celebrate Intellectual Diversity
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Tracking records to change/insert during CGI
by pboin (Deacon) on Oct 17, 2005 at 17:52 UTC | |
by ryantate (Friar) on Oct 17, 2005 at 21:10 UTC | |
by kiat (Vicar) on Oct 18, 2005 at 16:11 UTC |