I have a MySQL table that has files loaded as BLOBs into the table. The BLOB itself is in a field called EndUserForm. It's original name is saved in a field called EndUserFormName. If I were to run this code, for example, I get the file extracted out and saved into the tmp directory:
select EndUserForm into dumpfile "/opt/lampp/htdocs/GV-HS/tmp/exported1.txt" from ClientBillingInfo where ClientID = 1;
What I'd like to do is pull the file name out of the EndUserFormName and use it for the name of the exported file. Can I do this within the MySQL statement, or will I have to write a PHP script that first pulls the text name, then writes out the dump file? If I can do it within the script, how do I handle file names that have spaces in them?