万卷书   首页 > 电脑书籍 > PHP > 分页显示Oracle数据库记录的类之一
 
//-------------------------------------
// 以下构造函数、析构函数及初始化函数
//-------------------------------------

//构造函数
//参数:表名、最大行数、分页参考的字段、每页显示的页号数

function TOracleViewPage($TB,$ML,$id){
global $offset;

$this->Table=$TB;
$this->MaxLine=$ML;
$this->Id=$id;

$this->StartRec=0;
if(isset($offset)) $this->Offset=$offset;
else $this->Offset=0;

$this->Condition="";
$this->TheFirstPage=NULL;
$this->PageQury=NULL;
}

//初始化
//参数:用户名、密码、数据库
function InitDB($user,$password,$db){
if (PHP_OS == "WINNT") $dllid=dl("php3_oci80.dll");
$this->LinkId = OCILogon($user,$password,$db);
}

//断开
function Destroy(){
OCILogoff($this->LinkId);
}

上一页 下一页