打印本文 打印本文  关闭窗口 关闭窗口
操作Oracle的php类
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:35:23
trim(strtoupper($A_define[$i]));    //大写并去除空格
            }
            for($i=0;$i<count($A_define_up);$i++)
            {
                OCIDefineByName($this -> I_stmtID,"$A_define_up[$i]",&$$A_define[$i]);    //绑定
            }
        }
        elseif(trim($A_define) <> "")                //查询列只有一个
        {
            $A_define_up = trim(strtoupper($A_define));
            OCIDefineByName($this -> I_stmtID,"$A_define_up",&$$A_define);
        }

        //执行绑定好的SQL语句
        if(!OCIExecute($this -> I_stmtID))
        {
            echo "<font color=red><b>执行出错:</b></font>SQL Error:<font color=red>$C_sql</font><br>";
            return false;
        }
         
        $lower = 0;                    //返回二维数组的第一维下标控制变量
        $cnt = 0;                    //开始取数标识
         
        //取记录
        while (OCIFetchInto($this -> I_stmtID,&$cur,OCI_ASSOC))
        {
            //取查询出来的所有记录
            if ($I_start == -1)
            {
                if (gettype($A_define) == "array")        //查询列是数组
                {
                    for ($i=0;$i<count($A_define);$i++)
                    {
                        if ($cur[$A_define_up[$i]] <> $$A_define[$i])
                        {
                            $$A_define[$i] = $cur[$A_define_up[$i]];     
                        }
                        $A_rs[$lower][$i] = $$A_define[$i];                    //用数字访问
                        $A_rs[$lower][$A_define[$i]] = $$A_define[$i];        //用小些访问
                        $A_rs[$lower][$A_define_up[$i]] = $$A_define[$i];    //用大写访问
                    }         
                }
                elseif (trim($A_define) <> "")            //查询列只有一个
                {
                     
                    if ($cur[$A_define_up] <> $$A_define)
                    {
                        $$A_define = $cur[$A_define_up];     
                    }
                    $A_rs[$lower][0] = $$A_define;                    //用数字访问
                    $A_rs[$lower][$A_define] = $$A_define;        //用小写访问
                    $A_rs[$lower][$A_define_up] = $$A_define;    //用大些访问
                }
                $lower++;            //下标加一
            }
             
            //取出指定记录(配合分页使用)
            if ($I_start <> -1)
            {
                if ($cnt >= $I_start)
                {
                    $cnt++;
                    if ($I_end - $I_start <> 0)
                    {
                        $I_end--;
                            if (gettype($A_define) == "array")
                            {
                                for($i=0;$i<count($A_define_up);$i++)
                                {
                                    if ($cur[$A_define_up[$i]] <> $$A_define[$i])
                                    {
                   &

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



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