打印本文 打印本文  关闭窗口 关闭窗口
操作Oracle的php类
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:35:23
;                     //不是数组,是字符
        {
            global $$A_bind;
            $$A_bind = StripSlashes($$A_bind);
            $$A_bind = str_replace("<?","< ?",$$A_bind);                //过滤掉PHP标示
            OCIBindByName($this -> I_stmtID, ":$arrBind", &$$A_bind, -1);                 
        }
         
        //执行并检测是否成功
        if(!OCIExecute($this -> I_stmtID,OCI_DEFAULT))
        {
            echo "<font color=red><b>执行出错:</b></font>SQL Error:<font color=red>$C_sql</font><br>";
            return false;
        }
         
        /*//传回受影响的行数
        global $I_changenum;
        $I_changenum = OCINumrows($this -> I_stmtID);*/
         
        //释放句柄,传回值
        OCIFreeStatement($this -> I_stmtID);
        return true;
    }
//------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------------------
//        函数名:db_delete($C_sql)
//        作  用:delete
//        参  数:C_sql                    sql语句
//        返回值:布尔值
//        备  注:该函数只是为了使用直观,本质调用db_change()
//------------------------------------------------------------------------------------------
    function db_delete($C_sql)
    {
        return $this -> db_change($C_sql);
    }
//------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------------------
//        函数名:db_insert($C_sql,A_bind)
//        作  用:insert
//        参  数:C_sql                    sql语句
//                A_bind                    绑定
//        返回值:布尔值
//        备  注:该函数只是为了使用直观,本质调用db_change()
//------------------------------------------------------------------------------------------
    function db_insert($C_sql,$A_bind="")
    {
        return $this -> db_change($C_sql,$A_bind);
    }
//------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------------------
//        函数名:db_update($C_sql,A_bind)
//        作  用:update
//        参  数:C_sql                    sql语句
//                A_bind                    绑定
//        返回值:布尔值
//        备  注:该函数只是为了使用直观,本质调用db_change()
//------------------------------------------------------------------------------------------
    function db_update($C_sql,$A_bind="")
    {
        return $this -> db_change($C_sql,$A_bind);
    }
//------------------------------------------------------------------------------------------



//------------------------------------------------------------------------------------------
//        函数名:db_commit()
//        作  用:事务递交
//        参  数:无
//        返回值:布尔值
//        备  注:无
//------------------------------------------------------------------------------------------     
    function db_commit()
    {
        return    (OCICommit($this->I_linkID));
    }     
//------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------------------
//        函数名:db_rollback()
//        作  用:事务回退
//        参  数:无
//        返回值:布尔值
//        备  注:无
//------------------------------------------------------------------------------------------     
    function db_rollback()
    {
        return  (OCIRollback($this->I_linkID));
    }     
//------------------------------------------------------------------------------------------

     
//------------------------------------------------------------------------------------------
//        函数名:db_logoff()
//        作  用:断开数据库连接
//        参  数:无
//        返回值:布尔值
//        备  注:无
//------------------------------------------------------------------------------------------     
    function db_logoff()
    {
        return (OCILogoff($this->I_linkID));
    }
//------------------------------------------------------------------------------------------

     
//------------------------------------------------------------------------------------------
}
?> 

上一页  [1] [2] [3] [4] 



打印本文 打印本文  关闭窗口 关闭窗口