query(" SELECT student_name, class, MAX(score) as best_score FROM project_submissions WHERE status='approved' GROUP BY student_id ORDER BY best_score DESC LIMIT 10 "); $students = $stmt->fetchAll(); ?>
| Rank | Name | Class | Score |
|---|---|---|---|
| = $rank++ ?> | = htmlspecialchars($s['student_name']) ?> | = htmlspecialchars($s['class']) ?> | = $s['best_score'] ?> |