Connecting to MySQL in PHP using PDO.
Create a Simple Database App: Connecting to MySQL with PHP
The code is open source and available under the MIT License.