php mysqli get last insert id code example
Example 1: mysqli last index php
$last_id_inserted = mysqli_insert_id($conn);
Example 2: mysql get the last id php
// Insert query
$query = "insert into users(username,fname,lname) values('sonarika','Sonarika','Bhadoria')";
mysqli_query($con,$query);
// Get last insert id
$lastid = mysqli_insert_id($con);