How to store an email attachment in a MySQL database

This example shows how to save an email attachment in a MySQL database table. Loading file data differs from one database to another, they all use different SQL syntax and there are several methods for the same database.