Mysql LOCK help
Posted: Wed Mar 28, 2007 8:09 am
Hello.
I was trying to watch the behavior of the LOCK statement, and i did this:
and while this script is running i point the browser to another script
While script test_lock1.php is running i can run test_lock2.php and read from the table ...
Is this suposed to happen?
I was trying to watch the behavior of the LOCK statement, and i did this:
Code: Select all
//script test_lock1.php
<?php
include "private_functions.php";
lock_table("CONFIG");
$prefix = getPrefix("1");
$id = getID("SN");
echo "ID: $prefix".padWithZeros($id, 7)."<br>";
sleep(30);
echo "Sleep done...<br>";
unlock_table("CONFIG");
?>
in private_functions.php i'm locking the table using
...
mysql_query("LOCK TABLES CONFIG READ", $con);
...Code: Select all
//script test_lock2.php
<?php
include "private_functions.php";
$prefix = getPrefix("1");
$id = getID("SN");
echo "ID: $prefix".padWithZeros($id, 7)."<br>";Is this suposed to happen?