echo sql pdfo eror ph code example Example: pdo turn on errors $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);