sql - MySql on duplicate key set last_insert_id is causing auto_increment to jump -
i have query goes follows:
insert table(columns) values(values) on duplicate key update id=last_insert_id(id)
i use id of inserted or existing row of data.
$id=$connection->lastinsertid();
well have issue auto_increment
jumping each duplicate key update.
i on duplicate key
update part causing these jumps. source of problem? there way fix within query without reseting auto_increment
entirely every time?
Comments
Post a Comment