//读最新的记录 //topnum指定要读出的记录数 function ReadTopList($topnum){ $SQL="SELECT * FROM ".$this->Table." ".$this->Condition." ORDER BY ".$this->Id." DESC"; $stmt = OCIParse($this->LinkId,$SQL); $bool = OCIExecute($stmt); if (!$bool) { echo "连接失败!"; OCILogoff($this->LinkId); exit; } else { $ncols = OCINumCols($stmt); for ( $i = 1; $i <= $ncols; $i++ ) $column_name[$i] = OCIColumnName($stmt,$i); $k=0; for($j=0;$j<$topnum;$j++){ if(OCIFetch($stmt)){ $k++; for($i=1;$i<=$ncols;$i++) $temp[$column_name[$i]]=OCIResult($stmt,$i); $this->TopResult[]=$temp; } else break; } $this->TopNumber=$k; } OCIFreeStatement($stmt); return $this->TopResult; } |
正在阅读:分页显示Oracle数据库记录的类之二分页显示Oracle数据库记录的类之二
2004-02-14 09:33
出处:奥索网
责任编辑:zwg
键盘也能翻页,试试“← →”键