Using national assessment data linked to a survey of 1,150 teachers, this paper examines how teacher digital competence relates to student outcomes in mathematics and science in Philippine public secondary schools. Evidence on whether investment in teacher digital skills translates into learning gains, and under what conditions, remains limited. The study drew a stratified sample of 1,150 Grade 9 and 10 mathematics and science teachers from 230 public secondary schools across Luzon, Visayas and Mindanao, measured their digital competence with an instrument aligned to the European framework for the digital competence of educators, and linked responses to class-level results from the National Achievement Test. School connectivity was classified from Department of Education infrastructure records and verified by teacher report. Multilevel models with teachers nested in schools showed a positive association between teacher digital competence and class mean achievement in both subjects after controlling for teacher experience, qualifications, class size and school socioeconomic composition. The association was strongly conditional on connectivity: in schools with reliable internet access, a one standard deviation increase in digital competence was associated with 0.14 and 0.12 standard deviation gains in mathematics and science respectively, whereas in schools with unreliable or no connectivity the association was small and not statistically significant. Effects are concentrated in schools with reliable connectivity, highlighting infrastructure as a precondition for the returns to teacher digital competence. The findings imply that teacher training and connectivity investment should be sequenced and targeted together.