How do i make a script in php that puts a image name in mysql database and image itself in some outside folder [closed]

I’ve been playing around with php a bit lately and I have a little problem. I’m trying to make a plant atlas with the ability to add your own plant. The problem is that I do not know how to make it possible to attach a file in the form of html and the name of the photo was added to the database and the photo itself was added to a separate folder.

I tried to add it in BOB format but it didn’t work out as I wanted