Conclusion
There are a few situations in which it makes more sense to store binary data in a database instead of on the file system. As you’ve seen in this article, doing so isn’t that much more complicated than storing ordinary plain-text data. The database fundamentalsthe queries usedare the same; the biggest change is in the PHP script that sends the data back to the browser.
Now you can consider whether it makes sense to use the database instead of the file system to store binary data in your next web project.