Forms Database and Emails

I use a php upload files for a forms on my website that submit data to the database. I also use that php file to send a duplicate copy of the data submitted, to the email address of the instigator.

Because the database has grown in size and for the sake of easy of discovery. I now wish to include in that email as a ‘Reference’ the automatic increment (‘id’) so that subsequently the data in table can easily be located by citing the 'Ref Number (id)

I cannot find how to accomplish this.

I do understand that until the data from the form is submitted to the database the relevant “id” for that entry row is not generated so the code in the php submission file is unable locate that particular entity,

So does anyone have a solution to meet this objective?

Not sure what database you are using, but everyone that I have used has the ability to access the auto-created id for the last record created. You would just need to capture that id and add it to the email you create.

For MySQL it would be something like this SO thread mentions.

1 Like

Thanks for the reference, will work my way through it and see if can achieve the desired result.

Thanks for taking the time to help

Warren