class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
The logic in your code is flawed. You should read file_dst_name after each call to process(). Not to mention that you store twice the same variable in your database:
But more importantly, you shouldn't use the file upload.php. it is just provided as an example of implementation. You should write your own code.