Here’s an extremely basic, reusable PHP and MySQL based PDO class for easily connecting to multiple database servers simultaneously within a script without having to go through a bunch of hoopla. Tidbits have been pieced together from the following sources with a little tweaking of my own (such as the ability to have default database values or to pass them as arguments):
http://simple_pdo_implementation.onlinephpfunctions.com/
http://culttt.com/2012/10/01/roll-your-own-pdo-php-class/
http://code.tutsplus.com/tutorials/why-you-should-be-using-phps-pdo-for-database-access–net-12059
Continue reading “PHP – Simple PDO Class for Connecting to a MySQL Database”