Hello Binay.
Friday, December 19, 2003, 2:04:51 PM, you wrote:

B> Hi  Andrey,
B> many thanks for quick response. plz find my further query below.

>> AFAIR, you usu. do that with:
>> LOCK TABLE mytbl WRITE;
>> // do smth. here
>> UNLOCK TABLE mytbl;
B> ++++++++++++++++++
B> How can i achieve the same using PHP.
B> is it smth mysql_query(" LOCK TABLE mytbl WRITE")
B> or wht way ??
B> please suggest

Well, I've misspelled it someway... Here's a quote from the MySQL
manual:

LOCK TABLES tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE}
            [, tbl_name [AS alias] {READ [LOCAL] | [LOW_PRIORITY] WRITE} ...]
...
UNLOCK TABLES

Note "TABLES" instead of "TABLE". So, actually you'd do the following
(mytbl is the name of the table to lock):

mysql_query("LOCK TABLES mytbl WRITE");

Then, when done:

mysql_query("UNLOCK TABLES");

I hope that helps.

-- 
See you,
Andrey.

[ [EMAIL PROTECTED] | ICQ# 114087545 | 2:5090/[EMAIL PROTECTED] ]

...Elbonics: Two people maneuvering for one armrest in a movie theatre.

Reply via email to