Ignore:
Timestamp:
2009/06/12 14:45:35 (15 years ago)
Author:
Seasoft
Message:

・SC_DbConn#getRow の改訂
・SC_Query#getRow の改訂
・SC_Query#update の改訂
・ソース整形

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/class/SC_DbConn.php

    r17595 r18098  
    2727$objDbConn = ""; 
    2828 
    29 class SC_DbConn{ 
     29class SC_DbConn { 
    3030 
    3131    var $conn; 
     
    8686 
    8787        if ($this->conn->isError($result) && !$ignore_err){ 
    88             $this->send_err_mail ($result, $n); 
     88            $this->send_err_mail($result, $n); 
    8989        } 
    9090 
     
    105105        } 
    106106        if ($this->conn->isError($result)){ 
    107             $this->send_err_mail ($result ,$n); 
    108         } 
    109         $this->result = $result; 
    110  
    111         return $this->result; 
    112     } 
    113  
    114     function getRow($n, $arr = ""){ 
    115  
    116         // mysqlの場合にはビュー表を変換する 
    117         if (DB_TYPE == "mysql") $n = $this->dbFactory->sfChangeMySQL($n); 
    118  
    119         if ( $arr ) { 
    120             $result = $this->conn->getRow($n, $arr); 
    121         } else { 
    122             $result = $this->conn->getRow($n); 
    123         } 
    124         if ($this->conn->isError($result)){ 
    125             $this->send_err_mail ($result ,$n); 
     107            $this->send_err_mail($result ,$n); 
     108        } 
     109        $this->result = $result; 
     110 
     111        return $this->result; 
     112    } 
     113     
     114    /** 
     115     * クエリを実行し、最初の行を返す 
     116     * 
     117     * @param string $sql SQL クエリ 
     118     * @param array $arrVal プリペアドステートメントの実行時に使用される配列。配列の要素数は、クエリ内のプレースホルダの数と同じでなければなりません。  
     119     * @param integer $fetchmode 使用するフェッチモード。デフォルトは DB_FETCHMODE_ASSOC。 
     120     * @return array データを含む1次元配列。失敗した場合に DB_Error オブジェクトを返します。 
     121     */ 
     122    function getRow($sql, $arrVal = array(), $fetchmode = DB_FETCHMODE_ASSOC) { 
     123         
     124        // mysqlの場合にはビュー表を変換する 
     125        if (DB_TYPE == "mysql") $sql = $this->dbFactory->sfChangeMySQL($sql); 
     126         
     127        $result = $this->conn->getRow($sql, $arrVal ,$fetchmode); 
     128         
     129        if ($this->conn->isError($result)){ 
     130            $this->send_err_mail($result ,$sql); 
    126131        } 
    127132        $this->result = $result; 
     
    168173 
    169174        if ($this->conn->isError($result)){ 
    170             $this->send_err_mail ($result, $n); 
     175            $this->send_err_mail($result, $n); 
    171176        } 
    172177        $this->result = $result; 
     
    184189 
    185190        if ($this->conn->isError($result)){ 
    186             $this->send_err_mail ($result, $n); 
     191            $this->send_err_mail($result, $n); 
    187192        } 
    188193        $this->result = $result; 
Note: See TracChangeset for help on using the changeset viewer.