Write a PHP script for an in-development Facebook application using the Facebook API. The script would need to take a photo stored on a server and communicate with a MySQL database to upload a photo to Facebook when triggered, applying Facebook tags and uploading to the proper photo album.
The necessary fields would be:
Facebook User ID
The end result should be a working PHP script that uploads the photo, along with the above metadata.