Yes you seem to have it figured out, just do the lock in
a normal mysql_query, following the MySQL manual for syntax,
and you can release a lock whenever you want, but the
rule is the sooner the better, since if more then one page
or query tries to do a write, while you have it locked it
has to wait and wait until your lock is released.



On Fri, 2003-06-27 at 11:45, anders thoresson wrote:
> Hi,
> 
>  I've never used a lock on a MySQL table so far, but need one now. Two 
> questions:
> 
>  1. Do I set the lock by a normal query, but in the form of "LOCK TABLE 
> <tablename> WRITE", instead of "SELECT * FROM <tablename> WHERE x = 1"?
> 
>  2. Can I set the lock in one query, then perform multiple other queries on 
> the table, in between which I do some PHP work, and then release the lock 
> several queries and lines of PHP code later?
> 
>  In general, when is it wise to use a lock, and when is it uneeded?
> 
> -- 
> anders thoresson
-- 
Adam Voigt ([EMAIL PROTECTED])
Linux/Unix Network Administrator
The Cryptocomm Group


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to