SetQuery("select max(sequence) as num from StudentReward where studentId='$xKey'"); if ($result=$this->GetResult()) { return $result['num']+1; } } function RSStudentRewardByStId($stId){ $this->SetQuery("select * from StudentReward where studentId='$stId' order by receiveDate"); } } //--End class StudentReward-- ?>