setAttribute(PDO::ERRMODE_EXCEPTION,PDO::ATTR_ERRMODE); } catch (PDOException $e) { echo "An error has ocurred: " . $e->getMessage(); }