开发者

Is it true that the mysql extension of PHP doesn't support Transactions with "FOR UPDATE"?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜