My current projects consist of Registration of families of different areas in a City. i want to Generate a Unique ID to each families in which i need this ID for another part of this project.Each area in the city have already a unique number eg: 855, 856, 857,etc
So my plan is to generate unique Family ID by combining unique number already have + text "FM"+ number (1,2,3....) and store this uid to DB along with family details.
For eg (Area-855): 855FM1, 855FM2, 855FM3....
if the last registered family uid is 855FM40 , then next family uid must be 855FM41. so i want to fetch the largest value from uid field. in above eg:, largest is 855FM41. how i do this. ?
i have simple logic that fetch all uid, then split it after "FM". then find largest ,etc
How i solve this problem.? is there any simple way other than this.?