Find last inserted id in mysql - Mysql

Last Insert Id

Snippet Code


  
Rate this page :
  [ 0 votes]

We can use 'max(id)' to find the last inserted id. We can also use 'lastinsertid()' function in mysql.

$query="select max(id) from table1";

Tags


Ask Questions

Ask Question