Subject Re: [firebird-php] Grid data entry
Author almond@polydata.biz
Rajesh Kumar <rajesh@...> said:

> <html><body>
>
>
> <tt>
> Almond wrote:<BR>
> <BR>
> > My first idea is save the original data in array. Upon post back of
data, <BR>
> > compare the content. It is simple and stupid. But it is better than
re-read <BR>
> > the db and compare the record content row by row.<BR>
> > <BR>
> > Any good idea ?<BR>
> <BR>
> This sounds like a god idea, except for the fact of storing the old <BR>
> values as hidden fields (or session variables). Once the form has been <BR>
> submitted, you are going to be comparing old data. Numerous updates <BR>
> might have taken place from the time the form was loaded, to being <BR>
> submitted. What if someone loaded the page tonight, and submitted it <BR>
> next day morning?<BR>
> <BR>

I like newsgroup. I always learn something here :). Yes, I don't think about
this since I always set an time-out on the pages.

> Ofcourse this does not apply to cases where only you would be doing the <BR>
> updates.<BR>
> <BR>
> My theory is to get a fresh copy from the db (just one more query), and <BR>
> then compare the data, and then perform the update query for the <BR>
> modified data. Ofcourse, all this is very quick, as everything is looped.<BR>

Yes. I think this is the correct way and made the program code cleaner.

Thank you for your comment.

Best regards,

Almond Wong

> <BR>
> To prevent updates when data is being checked, table locking is recommend.<BR>
> <BR>
> Whatever, this method is still better than updating each and every row, <BR>
> but the hidden field theory doesn't seem to be practical.<BR>
> <BR>
> -- <BR>
> [ Rajesh Kumar ]<BR>
> __________________________________________<BR>
> Meet the guy at <a
href="http://www.meetRajesh.com/">http://www.meetRajesh.com/</a><BR>
> <BR>
> <BR>
> </tt>
>
> <br>
>
> <!-- |**|begin egp html banner|**| -->
>
> <table border=0 cellspacing=0 cellpadding=2>
> <tr bgcolor=#FFFFCC>
> <td align=center><font size="-1" color=#003399><b>Yahoo! Groups
Sponsor</b></font></td>
> </tr>
> <tr bgcolor=#FFFFFF>
> <td align=center width=470><a
href="http://rd.yahoo.com/M=259395.3614674.4902533.1261774/D=egroupweb/S=1705007183:HM/A=1524963/R=0/SIG=12o885gmo/*http://hits.411web.com/cgi-bin/autoredir?camp=556&lineid=3614674&prop=egroupweb&pos=HM"><img
src="http://us.a1.yimg.com/us.yimg.com/a/sl/sleepangel/sleep_300x250.gif"
alt="" width="300" height="250" border="0"></a></td>
> </tr>
> <tr><td><img alt="" width=1 height=1
src="http://us.adserver.yahoo.com/l?M=259395.3614674.4902533.1261774/D=egroupmail/S=:HM/A=1524963/rand=832176361"></td></tr>
> </table>
>
> <!-- |**|end egp html banner|**| -->
>
>
> <br>
> <tt>
> To unsubscribe from this group, send an email to:<BR>
> firebird-php-unsubscribe@yahoogroups.com<BR>
> <BR>
> </tt>
> <br>
>
> <br>
> <tt>Your use of Yahoo! Groups is subject to the <a
href="http://docs.yahoo.com/info/terms/">Yahoo! Terms of Service</a>.</tt>
> </br>
>
> </body></html>
>



--