UPDATE Books SET url='bookid='+LAST_INSERT_ID() WHERE id=LAST_INSERT_ID(); I want to update the last book inserted with an URL like this: bookid=34 (If last id is e.g 34)