How to write to a MySQL table?

Most of the apps that I build require some kind of back-end solution. A key task for this server side code is often to write data to a database. There are many different flavors of databases and server side languages. Here’s an example using PHP and MySQL.