Shekar Kumar Posted August 6, 2008 Share Posted August 6, 2008 Hai everyOne, I am facing the problem in getting my array of elements getting sorted acccording to the total points . ->ppose the conducted exams are '4' ---- exam1,exam2,exam3,exam4 -> in each exam he assures some points.say from 1 to 10. ->total points = sum of the points(exam1,exam2,exam3,exam4) Sorting must be done based on three conditions: 1. First the entire array lists must be sorted according to the total points 2. second if two rows have the same total points then it has to sort based on the highest individual points he secured in exams i.e., if totals for two studentsis say 20 for one student1 it is the sum of 5,5,4,6 ---> maxvalue is '6' and for the student2 it is the sum of 7,3,5,5 ----> maxvalue is '7' then i want to get the student2 on top of student1 in arranging the list in descorder i.e,a/c to highest points because student2 has get the maxvalue--7- which is greater than any rank of student1. this is how i want my records to be sorted. thanks in advance bai Link to comment https://forums.phpfreaks.com/topic/118377-i-want-to-sort-the-data-ie-fetched-from-the-database-based-on-total-points/ Share on other sites More sharing options...
unkwntech Posted August 6, 2008 Share Posted August 6, 2008 What does your query look like now? Link to comment https://forums.phpfreaks.com/topic/118377-i-want-to-sort-the-data-ie-fetched-from-the-database-based-on-total-points/#findComment-609242 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.