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

Code Example 1

-- For mysql
INSERT INTO table_name (col1, col2,...) VALUES ('val1', 'val2'...);
SELECT LAST_INSERT_ID();

Learn ReactJs, React Native from akashmittal.com