The other day I recently wrote a program that takes a file that a user provided and inserts the actual file(driver) into a MySQL database BLOB. I did the insertion as follows:
$sql = "INSERT INTO Drivers (driver, filename, status, version, environments) VALUES(LOAD_FILE('$driver'), '$filename', $statusid, $driver_version, '$environments')";
As you can see above, the 'driver' field is the BLOB. I have the filename as well in a different field. So the question is, how can I easily get the BLOB and put it back into an actual file? I need to get this into a file so that I can upload it to a server via SCP. I've seen a few examples out there with content headers and such and they all look too complicated. It was easy to load with LOAD_FILE() and I didn't know if there was another simple option to get it back to an actual file? Sorry I don't have any code examples. I really don't know where to start.