Migration from mysql extension to PDO