<?php
/**
 * Created by PhpStorm.
 * User: Langdon
 * Date: 08.03.16
 * Time: 15:02
 */
include(ROOT.'/components/Db.php');
class Student {

    public static  function getStudentList(){
        $db = Db::getConnection();

        $StudentList = array();
        $result = $db->query("SELECT * FROM studets ORDER BY marks DESC");


        $i = 0;
        while($row = $result->fetch()){

            $StudentList[$i]['firstName'] = $row['firstName'];
            $StudentList[$i]['secondName'] = $row['secondName'];
            $StudentList[$i]['number'] = $row['number'];
            $StudentList[$i]['marks'] = $row['marks'];
            $i++;
        }

        return $StudentList;
    }
} 