PDO Completed and Bug Fix

Every function use PDO.
Bug Fix: Check if results
Bug Fix

Check if results bug fix