this code will insert the last inserted ID from a table to an another table