I have a record locking problem that is caused by refreshing the browser.
I have one MySQL table with a primary key composed of table name and record ID number.
If a user wants to edit a record in another table, the php page sends a query to this table to see if that record number in that table is currently being edited. If it is not, a record is added to the record locking table and the user can edit the record from the other table.
When the user clicks a Save or Cancel button, another query is sent from the php page to the record locking table to unlock the record.
Here's the problem. If a user refreshes the page when editing a record, clicks the Retry button to resend the query and reload the page, the MySQL table correctly indicates that the record is locked for editing (by the user who refreshed the browser) and does not allow the same user to continue editing the record. The record remains locked until the Table containing the record locking data is edited by another means.
Any ideas on how to prevent this from happening? Is there a way to intercept a request to refresh a page, to temporarily block a refresh button, to determine when a user has clicked a refresh button and change the code for reloading the page?
Thanks!
Timm