Could be one for sql forum rather than php, so please feel free to move it...
I am writing a php script that modifies a mysql database which more than one person may be accessing simultaneously and I need to lock the table for a short time to stop anyone else making modifications at the same time. I think I understand the syntax to lock and unlock the table, but my problem is this: If a user starts the modification process (an therefore causes the table to lock) but then doesn't complete it (so the table isn't unlocked) the table will remain locked. Is there a way to lock a table in such a way that the lock will expire after a given time?
Thanks!
I am writing a php script that modifies a mysql database which more than one person may be accessing simultaneously and I need to lock the table for a short time to stop anyone else making modifications at the same time. I think I understand the syntax to lock and unlock the table, but my problem is this: If a user starts the modification process (an therefore causes the table to lock) but then doesn't complete it (so the table isn't unlocked) the table will remain locked. Is there a way to lock a table in such a way that the lock will expire after a given time?
Thanks!