get the id of record just entered?

wxdqz

New Member
Hi.. i m having this problem:

I defined a table with the primary key as an integer with auto increament. How can i get primary key assigned by the database system for the record i just entered? example

sql = "INSERT INTO bla (id, f1, f2) VALUES ('', 'bla1', 'bla2')";

How to know the id assigned by the system to the record i just entered?

The only way i know is query back the database of the highest id value. Any other way?

Any idea?
 
Back
Top