rewrote to use PDO
Merge pull request #1 from mrhazel/feature/php-rewrite

rewrote to use PDO