开发者

How to pass table name using the LAST_INSERT_ID keyword in MySQL?

How do 开发者_开发百科you to find last identity insert value in MySQL, with table name as parameter?

When I use the LAST_INSERT_ID() keyword, I can't get the table name.


You can not do that, indeed.

I suggest you to work it at the application level - in PHP/Python/Ruby/Perl, etc


There is no such functionality, due to scope issues.
Without calling LAST_INSERT_ID in the context of a transaction, there is no way to know if the value is actually related to your insert or someone else's.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜