setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); }catch(Exception $e){ echo $e->getCode().': '.$e->getMessage(); }