php - Prepared statement not executing under lock -
i'm finding can't execute prepared statement under table lock, page locks though command waiting release , have manually kill lock.
this example case:
mysql_query("lock table tbl write"); $stmt = $mysqli->prepare("insert tbl (id) values (?)"); $stmt->bind_param("i", $nextid); $stmt->execute(); mysql_query("unlock tables");
is there reason why case? before introducing prepared statements worked fine execution without lock.
learning purposes please no comments on why needs locked , auto-incremented id's :)
thank you.
mysql_query
$mysqli->prepare
you locking table in connection established mysql_connect
no wonder table got locked in other connections, included 1 created mysqli.
Comments
Post a Comment