I have a query that goes as follows:
insert into TABLE(COLUMNS) values(VALUES) on duplicate key update id=last_insert_id(id)
I use this to get an ID of inserted or existing row of data.
$id=$connection->lastinsertid();
Well now I have a issue with my auto_increment
jumping with each duplicate key update.
I am fairly certain on duplicate key
update part is causing these jumps. Is this the source of the problem? Is there a way to fix this within the query without reseting auto_increment
entirely every time?