How to get ID of the last updated row in MySQL?

后端 未结 12 2254
北海茫月
北海茫月 2020-11-22 08:10

How do I get the ID of the last updated row in MySQL using PHP?

12条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 08:26

    ID of the last updated row is the same ID that you use in the 'updateQuery' to found & update that row. So, just save(call) that ID on anyway you want.

    last_insert_id() depends of the AUTO_INCREMENT, but the last updated ID not.

提交回复
热议问题