This topic is locked

Lock field

8/11/2009 10:23:02 AM
PHPRunner General questions
M
mauro author

I created a lock Field to avoid that two differents users work on the same data in the same time, it's works....i use 0 and 1 value in the database and field is unlocked before record is updated...
> BEFORE RECORD UPDATED<

global $conn;
$strUpdate = "update table set IsLocked=0, LockTime=NOW() where ".$where;
but if user don't save record, for example edit but don't save, edit and close browser without save data......Locked filed is always 1 and no other user cab modify values....how cai i resolve?

J
Jane 8/12/2009

Hi,
you can lock record for 20 minutes only. Check Edit page: Before display event in this article:

http://www.xlinesoft.com/phprunner/docs/im...ord_locking.htm

M
mauro author 8/12/2009

Hi,

you can lock record for 20 minutes only. Check Edit page: Before display event in this article:

http://www.xlinesoft.com/phprunner/docs/im...ord_locking.htm


Tnx i use this code, but if a user click on Back button or close page or....ticket is always locked or locked until 20 minutes....

J
Jane 8/12/2009

Hi,
unfortunately there is no reliable way to unlock record when user just close the window.
You can pass parameters in the Back to list button and unlock record on the List page: Before process event manually.

Here is just a sample Back to listURL (use this code in the Edit page: Before display event):

$xt->assign("backbutton_attrs","onclick=\"window.location.href='TableName_list.php?a=return&id=".$_REQUEST["editid1"]."'\"");