I'm working on a user management system that uses PHP and mysql.(XAMPP) it has around 1000+ user records in A table called "users" with "id" as primary key. one of the columns is "avatar" I have a folder with 1000+ jpg images. all user images are named by their ids. for example if a user named Jon with id=222 his photo will be 222.jpg
what I want to do is upload all photos to their users using the image name to be put to the correct user id in the table
what's the best approach I can take? hope its clear and thanks in advance
I have some steps that you might do :
Upload file as usual, but in this step you must include user id as parameter
Query user by id
Rename file before save image, example :
Upload it to folder
Save to your table