打印本文 打印本文  关闭窗口 关闭窗口
操作Oracle的php类
作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:35:23
nbsp;                    $$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++;
                    }else
                    {
                        break;        //如果$I_end-$I_start=0  表示取完记录并跳出while循环
                    }     
                }else
                {
                    $cnt++;        //如果$cnt<$I_start,$cnt++
                }                 
            }
             
        }     //while的结束
         
        //释放句柄并返回查询数据(一个二维数组)
        OCIFreestatement($this -> I_stmtID);
        return $A_rs;      
         
    } //function的结束
//------------------------------------------------------------------------------------------


//------------------------------------------------------------------------------------------
//        函数名:db_change($C_sql,$A_bind)
//        作  用:db change
//        参  数:$C_sql                        sql语句
//                $A_bind                        需绑定的字段。数组型         
//        返回值:布尔值
//        备  注:insert,delete,update通用
//------------------------------------------------------------------------------------------
    function db_change($C_sql,$A_bind="")
    {
        if (!$C_sql){AlertExit("参数不全!");}//检查参数
         
        //连接检测
        if($this -> I_linkID==""){    AlertExit("我们的数据库正忙,请稍后再连接!");}     
         
        //格式检测
        $this -> I_stmtID = OCIParse($this -> I_linkID,$C_sql);     
        if (!$this -> I_stmtID){AlertExit(' sql格式出错!请与程序员联系');}
         
        //绑定
        if(gettype($A_bind) == "array")
        {
            for($i=0;$i<count($A_bind);$i++)
            {
                global $$A_bind[$i];
                $$A_bind[$i] = StripSlashes($$A_bind[$i]);            //去掉反斜线字元
                $$A_bind[$i] = str_replace("<?","< ?",$$A_bind[$i]);    //过滤掉PHP标示
            }
            for($i=0;$i<count($A_bind);$i++){
                OCIBindByName($this -> I_stmtID, ":$A_bind[$i]", &$$A_bind[$i], -1);  //绑定
            }
        }
        elseif(trim($A_bind) <> "")           

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



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