Ignore:
Timestamp:
2010/01/10 10:55:55 (14 years ago)
Author:
Seasoft
Message:
  • 使用するフェッチモードの指定を可能とした。
    • getAll#getAll
    • SC_Query#getall
    • SC_Query#select
  • PHP_Document 追加
  • 引数の変数名を分かりやすいものに変更
File:
1 edited

Legend:

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

    r18280 r18487  
    8686     * @param string $where WHERE句 
    8787     * @param array $arrval プレースホルダ 
     88     * @param integer $fetchmode 使用するフェッチモード。デフォルトは DB_FETCHMODE_ASSOC。 
    8889     * @return array|null 
    8990     */ 
    90     function select($col, $table, $where = "", $arrval = array()){ 
     91    function select($col, $table, $where = "", $arrval = array(), $fetchmode = DB_FETCHMODE_ASSOC) { 
    9192        $sqlse = $this->getsql($col, $table, $where); 
    92         $ret = $this->conn->getAll($sqlse, $arrval); 
     93        $ret = $this->conn->getAll($sqlse, $arrval, $fetchmode); 
    9394        return $ret; 
    9495    } 
     
    147148    } 
    148149 
    149     function getall($sql, $arrval = array()) { 
    150         $ret = $this->conn->getAll($sql, $arrval); 
     150    /** 
     151     * クエリを実行し、全ての行を返す 
     152     * 
     153     * @param string $sql SQL クエリ 
     154     * @param array $arrVal プリペアドステートメントの実行時に使用される配列。配列の要素数は、クエリ内のプレースホルダの数と同じでなければなりません。  
     155     * @param integer $fetchmode 使用するフェッチモード。デフォルトは DB_FETCHMODE_ASSOC。 
     156     * @return array データを含む2次元配列。失敗した場合に 0 または DB_Error オブジェクトを返します。 
     157     */ 
     158    function getall($sql, $arrval = array(), $fetchmode = DB_FETCHMODE_ASSOC) { 
     159        $ret = $this->conn->getAll($sql, $arrval, $fetchmode); 
    151160        return $ret; 
    152161    } 
Note: See TracChangeset for help on using the changeset viewer.