Script 1.
$query_ = \"lock tables test1 as test11 write\"; mysql_query($query); $query_ = \"select * from test11\"; sleep(20); $query_ = \"unlock tables\"; m
You have to grant the rights of lock tables to the db user.