PDO Updates

updated a few prepared statements in the functions.php, also minor bug
fixes