How are you developers.
I am trying implement a multiple images upload system on my website.
I want to know how to rename multiple images and store their path names into MySQL database using php. But if possible some JavaScript can be added.
I have searched through the net but I have found no working answer. Please help me..... Below is the code.
I am try to avoid images existing files being overwritten in case someone uploads images of the name that are already in the directory.
You can use the rename function of PHP to rename your files: https://www.php.net/manual/pt_BR/function.rename.php
If you want to rename multiple files, you can create a function that will search through the file folder (using for, while etc) and rename 1 by 1 using some parameter.
To store the file path, you can simply use a mysqli query to store the file path to your database.