the idea is to do a php script (or equivalent) that interact with your mysql databse and return a xml or json file that you can parse, containing the link of the image (or the base64 encoded image, but my advice is to use a link to the file if possible). Then you will use ASIHTTPRequest or NSURLConnection to do an asynchronous request to your php script, and then parse the xml\json returned with NSXMLParser or SBJson, at this point you will have a link to the file (that you can download again with ASIHTTPRequest or NSURLConnection) or a text that represent the image in base64, you can use
this tip to convert base64 string to NSData and then create a UIImage with that.