Esempio n. 1
0
 /**
  * 準備済みSQL文をまとめて実行する(INSERT/UPDATE/DELETE専用)
  * ※配列データを一括登録するなどに使用する。
  * ※SQLの解析が繰り返し行なわれないため処理が早い。
  * (同じSQLを繰り返し実行する場合に使用する)
  * <処理内容>
  * ・SQLの解析(prepare)はせずに準備済みのSQL文を実行する
  * ・実行途中で処理が失敗した場合、以降のデータは処理されません。
  * ・SQL文の実行エラーが発生したら、トランザクションをロールバックする
  * @access public
  * @param string $sql SQL文
  * @param array $data SQL文にセットする配列データ
  * @return object SQL文の実行結果
  * 		(INSERT/UPDATE/DELETEが成功した場合、DB_OKをセットする)
  * @throws DatabaseException SQL文の実行エラーが発生した時
  */
 function execMultipleSql($sth, $data = array())
 {
     $rs =& $this->db->executeMultiple($sth, $data);
     if (DB::isError($rs)) {
         $this->db->rollback();
         throw new DatabaseException($rs->getMessage());
     }
     return $rs;
 }
Esempio n. 2
0
 /**
  * Executes multiple queries performing variables substitution for each query
  *
  * @param string $stmt text of the request to send to the LDAP server
  * @param array $data query variables values to substitute
  * @param string $action type of request to perform, defaults to search (ldap_search())
  * @param array $params array of additional parameters to pass to the PHP ldap function requested
  * @return LDAP_result object or DB Error object if no result
  * @see DB_common::executeMultiple
  */
 function executeMultiple($stmt, &$data, $action = null, $params = array())
 {
     $this->q_action = $action ? $action : $this->action;
     $this->q_params = $params;
     return parent::executeMultiple($stmt, $data);
 }