[PHP] mysql lock

2003-06-27 Thread anders thoresson
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

Re: [PHP] mysql lock

2003-06-27 Thread Adam Voigt
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