Mysql
 SQL >> Datenbank >  >> RDS >> Mysql

Letzte eingefügte ID aus MySQL-Tabelle erhalten

Mit mysqli:

$last_id = mysqli_insert_id($conn);

Mit PDO:

$last_id = $pdo->lastInsertId();

Die alte Funktion mysql_insert_id() ist veraltet.