In PHP MySQL how to sum or not sum multiple columns?
Could add them up in SQL by reverting to 0 for NULL columns like:

SELECT students_info.s_name, subjects.subject, marks.*, 
       COALESCE(marks.n1, 0) + COALESCE(marks.n2, 0) +COALESCE(marks.n3, 0) as  sum_marks
FROM ....