Please see the Image below and you will get the context related to my question .

The web site is a Site for talented Photographers where they can Upload Pictures and allow others to see what they have taken .
I am struck Up in my work , due to a design Issue .
A user ( No registration required ) can open my Website and Upload details like Name , Mobile , description , Image (The same user can upload different images ) at which mobile number is mantadatory field . so while Uploading the Picture , i am appending it with Mobile Number + FileName.jpg , and the Image will be stored inside a folder inside my server and the remaining details like mobile num , desc , name –etc will be Stored inside MYSQL Database . (This is one part and its completed )
2nd part is
On Page start up , i am getting all the images (latest 20 fixed ) from the that folder and showing it on the page .
So when any user clicks on a particulr Image i need to show the deetails like Desc , Name , —etc , so on onclick event of that image , i am picking up the Mobile number from the image clicked and making a search in Database . (Now there is a problem here ) that is , A same user ( that is with same mobile number ) can upload different pictures to the web site , so the search using the Mobile number will give me many results .
The picture name format is 83746787695iokI.jpg .
I am ready to chAange any format , so please tell how this can be solved
Given a filename
83746787695iokI.jpgyou should be able to parse the uploader phone number and the original filename, then query your table of photos using those values. A regex for that could be:Having said that, you should consider assigning a unique identifier to each photo and use it to name your saved files. An id column in MySQL could look like this:
After insertion, get the id of the new row (
LAST_INSERT_ID()in MySQL) and save your file with its name being#{id}.jpg.Note that the autoincremented id is a predictable integer, your filenames will be
1.jpg,2.jpg, etc. A simple script can be used to download all images from your server. To avoid that, name your files using a random generated unique string instead, e.g. UUID. Store that string in a new column in your table and use that to identify your photos.