WordPress.org

Make WordPress Core

Opened 2 months ago

#47818 new enhancement

$wpdb should update ->insert_id also when `LAST_INSERT_ID(...)` is found

Reported by: cpiber Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Database Keywords:
Focuses: Cc:
PR Number:

Description

It is possible to set the insert id pointer manually by in including LAST_INSERT_ID(column) anywhere in the statement. $wpdb however does not update it's internal insert_id, it does this only when the statement is 'insert' or 'replace'. This makes it harder to get the ID of an updated row.
https://stackoverflow.com/a/46335863

Change History (0)

Note: See TracTickets for help on using tickets.