I'm working on a web interface to do some rather simple DB maintenance. Low volume SELECTs & UPDATEs mostly.

The form will have a handful of simple records displayed from a few tables. For purposes of discussion, let's say we have 5 records from each of two tables. Also, let's say that I'm displaying the PKey read-only, and I have form inputs for the other fields. Each set of records is followed by a new blank row, in case the user wants to INSERT a new record.

Which what mechanism would you recommend I keep track of what data has been offered and returned? (Specifically, so I can build my SQL.) Right now, I have generated fieldnames that hold the table and the rowID, but this is grossly, horribly insecure, and I know that. TMTOWTDI, and this is a *poor* way.

Secondly and less importantly, can you recommend a mechanism that will help me know when my data is 'dirty'? That way, I can minimize my transactions to those that are neccessary. I could roll my own with standard comparison, but this is one of those cases where I feel I'm about to poorly re-implement the proverbial wheel.

Thank you Monks.


In reply to Tracking records to change/insert during CGI by pboin

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.