My query below is arranging students in a class by order of highest mark perfectly well, my problem however is how to have their class position displayed? What’s the php code I should write?
SELECT *
FROM f_teachers, summary1
WHERE f_teachers.year = summary1.yr AND f_teachers.class= summary1.clas AND t_id=%s
ORDER BY mark ASC;
i looked at this question a while ago, saw that you were asking for php code, and noted to myself that you were astute enough to realize that php is where ranking should be done on an ordered dataset
and as i don’t do php, i just passed it by
now i’ve noticed this thread has been moved to the databases forum, which i find rather curious
ranking should be done with php, assuming that the query indeed returns more than one student
(you really didn’t give very much information on what t_id=%s is for, but i’m gonna guess it’s teacher)
despair not, though, because some of our database guys do indeed know php
p.s. the move of this new thread from php to databases forum is ~especially~ curious because posting in the php forum was exactly what i recommended you do in this thread