There is a function to know what was the last id inserted in the current connect Im MySQL SELECT LAST_INSERT_ID(); With PDO: $pdo->lastInsertId(); With Mysqli: $mysqli->insert_id; Related Posts:MySQL php arabic not showingHow to make text blink on my web pagePHP Syllabus for self training programPHP Syllabus for self learners8 Useful jQuery Techniques For URLs by anvar Published : Mar , 16