How to find the last insertion value for insertion in MySQL, with table name as parameter?
When I use the keyword LAST_INSERT_ID(), I cannot get the table name.
LAST_INSERT_ID()
You cannot do this.
I suggest you work at the application level - in PHP / Python / Ruby / Perl, etc.
There is no such functionality due to problems with the area.Without invoking LAST_INSERT_IDin the context of a transaction, there is no way to find out if the value is really related to your insert or someone else's.
LAST_INSERT_ID