Skip to main content
Topic: Get last record inserted ID in a table (Read 952 times) previous topic - next topic

Get last record inserted ID in a table

In a "Form wizard" a have an ADD Table. when I insert a new record, I need to show the autoincrement ID for the table in the last step of the wizard.
Is there a way to use LAST_INSERT_ID MySql function or other method?

Re: Get last record inserted ID in a table

Reply #1
The question is where do you want to use it? If you want to use it on the form wizard, it is not possible. You can only get access to the last inserted record if in the page events. The way you do that is by using $rec_id, that variable always contains the last inserted record in Action After Add in Page Events