grabbing autoinc ref on newly inserted record
Posted: Sun Jan 25, 2004 2:01 pm
Hi, treat me gentle please - I'm new to this.
I have a form that inserts a new record into mysql table which uses an autoincrement field as it unique identifyier. Is there anyway to grab and return the unique indentifier ref. when the record is inserted. I want to be able to tell the user the reference for the record they have just inserted.
My thoughts are that I cannot do it by finding the previous record and adding one as other users on the site will be adding records at the same time.
I've got a horrible feeling that someone will look at this and think - "DOH - thats basic stuff!!!!" but like i say i'm new to this.
Any help muchly appreciated
I have a form that inserts a new record into mysql table which uses an autoincrement field as it unique identifyier. Is there anyway to grab and return the unique indentifier ref. when the record is inserted. I want to be able to tell the user the reference for the record they have just inserted.
My thoughts are that I cannot do it by finding the previous record and adding one as other users on the site will be adding records at the same time.
I've got a horrible feeling that someone will look at this and think - "DOH - thats basic stuff!!!!" but like i say i'm new to this.
Any help muchly appreciated