1

How to get the just-inserted record ID (mysql)? What i'll add to query:

INSERT INTO `osoby` (`imie`,`nazwisko`)
VALUES ('wartość','wartość2')

? thanks.

1 Answers1

5

To get the last inserted id use

SELECT LAST_INSERT_ID()

See the documentation

Denys Séguret
  • 372,613
  • 87
  • 782
  • 758