MySQL auto incremented field to generate unique ID for the record. We can get a unique auto PHP PDO function · Use insert_id() PHP MySQLI function .