What is a LOCK TABLES?
LOCK TABLES WRITE READ nazev_tabulky, nazev_tabulky;
-locks the listed tables for reading (READ) or writing (WRITE)-After the lock shall have the right to read, or write in the table only those commands that is located between the LOCK ... UNLOCK
UNLOCK TABLES: -unlock all locked tables
BEGIN; dotaz1; dotaz2; dot ...; COMMIT;
-only for InnoDB table type -all queries shall be carried out only under the assumption that the concentration will not interrupt until execution of the MySQL COMMIT-If the connection is interrupted during the polling, not even one query between the BEGIN and COMMIT
SELECT co_nacist FROM odkud_nacist LOCK IN SHARE MODE:
-only for InnoDB table type-wait for the query to finish the current questions and then retrieves the record
More information concerning MYSQL DB, see for example here http://dev.mysql.com/doc/index.html