Form submit counter / Registation number

Form submit counter / Registation number

I'd like to send a unique number back to every person that uses my form and store it in a database field. It would be for a registration number, but other applications could be trouble tickets, etc.

I am currently responding to each form submission (registration) manually and need to automate this.

I couldn't find anything similar in previous posts. Does anyone have any thoughts on how to do this?