If I use the following code my "row lock" works fine:
mysqli_query($link, 'START TRANSACTION');
mysqli_query($link, 'SELECT * FROM '. $table .' WHERE id开发者_运维问答=1 FOR UPDATE');
Unforunatly my server doesn't support "mysqli". Is it true that the following (with "mysql") doesn't work?
mysql_query($link, 'START TRANSACTION');
mysql_query($link, 'SELECT * FROM '. $table .' WHERE id=1 FOR UPDATE');
Is there a workaround? Thanks
OK - If I use
mysql_query('START TRANSACTION', $link);...
instead of
mysql_query($link, 'START TRANSACTION');...
it works.
精彩评论