I now have the files being renamed correctly by adding the following.
How do i now get the 2 new names and store them in the database. At the moment the insert query looks like this
This is located right at the ned of the script. Is this the best place for it or, should it be moved inside the actual uploading part.