how to check error in pdo exception update query code example Example: pdo turn on errors $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);