MySQL Locking Question
| From: | Chip | Date: | Sat, 06 Oct 2001 00:02:29 +0000 |
| Subject: | MySQL Locking Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70162@lists.php.net to get a copy of this message | ||
I'm preparing to write a DB app using PHP as the programming interface. I
need to be able to lock records at certain points. I was wondering if the
following is possible using PHP.
1. I want to use the GET_LOCK(str, timeout) function to lock records based
on the record ID. Can GET_LOCK be called through PHP??
2. If the GET_LOCK fails (Someone else allready has the lock for that
record), I want to make the PHP code to continue attempting to GET_LOCK
until it is available. Can you do events every 5 seconds until success in
PHP?
THANKS!