mysql-python: How can I retrieve the ID of the last record I added?
gabriel_ambuehl at buz.ch
Fri Sep 28 15:46:27 CEST 2001
-----BEGIN PGP SIGNED MESSAGE-----
I've got a MySQL table which has got an id field that is declared as
auto_increment so every record added gets its own unique id. So far
good, but how can I fetch the id of the last record added? I know I
can do some SELECT to gather the ID but if there are two completely
identical records, which is possible, it won't do me any good. So is
there some library function to reliably retrieve the id of the last
record I inserted into the table?
-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5i
-----END PGP SIGNATURE-----
More information about the Python-list