faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MSSQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

12 of 23 people (52%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I lock and unlock tables using PHP and MySQL?

Sep 25th, 2000 09:15
Narendra Jain, Gary Smith,


You Have to use the 'LOCK TABLE $tab_name' command to do this, as shown
below:
$db = mysql_connect("localhost", "myuser");
mysql_select_db("mydb", $db);
$tab_name = "employee";
$sql = "lock table $tab_name";
$result = mysql_query($sql);