<?php include("config.php"); $total = "select Total from student"; $x= mysql_query($total); while($t = mysql_fetch_array($x)) { $numbers[] =$t['Total']; function maxN(array $numbers, $n) { $maxHeap = new SplMaxHeap; foreach($numbers as $number) { $maxHeap->insert($number); } return iterator_to_array(new LimitIterator($maxHeap, 0, $n)); } print_r( maxN( $numbers, 10 ) ); } //print_r( maxN( array(7,54,2,4,26,7,82,4,34,99,21,67), 4 ) ); $merit = "select merit from student"; $result = mysql_query($merit); while($raw = mysql_fetch_array($result)) { } ?>
LIMIT
$total = "select Total from student order by total limit 0,9";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)