I know how LAST_INSERT_ID() works for auto incremented columns, but I cannot find a way to get the last id I inserted for a non auto incremented column.
Is there a
you can easily do that using the same LAST_INSERT_ID().
LAST_INSERT_ID()
INSERT INTO thetable (id, value) VALUES (LAST_INSERT_ID(126), 'some data'); SELECT LAST_INSERT_ID(); -- returns 126