In practice this is not... a good way to do this.

Why not? I've been doing exactly that in my custom record editor for the past half-dozen years or so (I always use it with PostgreSQL, though compatibility with MySQL is maintained).

If you can require javascript, then doing an ajax record editor would be better, because you can detect changes through form events rather than the equivalent of "diff -u".(In fact, they is already a variety of self-contained AJAX viewer/updater systems with that feature.)

A much simpler way to do it is to just update every record all the time, even if the user changed nothing, but it's a criminal waste of database resources (particularly if you allow editing a few dozen rows per screen).

--Daniel


In reply to Re: MySQL and Perl CGI by danb
in thread MySQL and Perl CGI by PyrexKidd

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.