Check out example codes for "mysql get last inserted id". It will help you in understanding the concepts better.

Code Example 1

$this_id = mysqli_insert_id($db);

Code Example 2

-- To get the last inserted auto-increment row ID: --
SELECT LAST_INSERT_ID( optional_expression )

-- If you have just inserted it using a command in C# use: --
int lastId = (Int32)yourCommand.LastInsertedId;

Learn ReactJs, React Native from akashmittal.com