当前位置: 首页>>代码示例>>PHP>>正文


PHP DatabaseBase::insertSelect方法代码示例

本文整理汇总了PHP中DatabaseBase::insertSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseBase::insertSelect方法的具体用法?PHP DatabaseBase::insertSelect怎么用?PHP DatabaseBase::insertSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DatabaseBase的用法示例。


在下文中一共展示了DatabaseBase::insertSelect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insertSelect

 /**
  * INSERT SELECT wrapper
  * $varMap must be an associative array of the form array( 'dest1' => 'source1', ...)
  * Source items may be literals rather than field names, but strings should be quoted with Database::addQuotes()
  * $conds may be "*" to copy the whole table
  * srcTable may be an array of tables.
  */
 function insertSelect($destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseMssql::insertSelect', $insertOptions = array(), $selectOptions = array())
 {
     $ret = parent::insertSelect($destTable, $srcTable, $varMap, $conds, $fname, $insertOptions, $selectOptions);
     if ($ret === false) {
         throw new DBQueryError($this, $this->getErrors(), $this->lastErrno(), '', $fname);
     } elseif ($ret != NULL) {
         // remember number of rows affected
         $this->mAffectedRows = sqlsrv_rows_affected($ret);
         return $ret;
     }
     return NULL;
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:19,代码来源:DatabaseMssql.php

示例2: insertSelect

 /**
  * INSERT SELECT wrapper
  * $varMap must be an associative array of the form array( 'dest1' => 'source1', ...)
  * Source items may be literals rather than field names, but strings should
  * be quoted with Database::addQuotes().
  * @param string $destTable
  * @param array|string $srcTable May be an array of tables.
  * @param array $varMap
  * @param array $conds May be "*" to copy the whole table.
  * @param string $fname
  * @param array $insertOptions
  * @param array $selectOptions
  * @throws DBQueryError
  * @return null|ResultWrapper
  */
 public function insertSelect($destTable, $srcTable, $varMap, $conds, $fname = __METHOD__, $insertOptions = array(), $selectOptions = array())
 {
     $this->mScrollableCursor = false;
     try {
         $ret = parent::insertSelect($destTable, $srcTable, $varMap, $conds, $fname, $insertOptions, $selectOptions);
     } catch (Exception $e) {
         $this->mScrollableCursor = true;
         throw $e;
     }
     $this->mScrollableCursor = true;
     return $ret;
 }
开发者ID:biribogos,项目名称:wikihow-src,代码行数:27,代码来源:DatabaseMssql.php

示例3: insertSelect

	/**
	 * INSERT SELECT wrapper
	 * $varMap must be an associative array of the form array( 'dest1' => 'source1', ...)
	 * Source items may be literals rather than field names, but strings should be quoted with Database::addQuotes()
	 * $conds may be "*" to copy the whole table
	 * srcTable may be an array of tables.
	 * @param string $destTable
	 * @param array|string $srcTable
	 * @param array $varMap
	 * @param array $conds
	 * @param string $fname
	 * @param array $insertOptions
	 * @param array $selectOptions
	 * @throws DBQueryError
	 * @return null|ResultWrapper
	 */
	function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = __METHOD__,
		$insertOptions = array(), $selectOptions = array() ) {
		$ret = parent::insertSelect( $destTable, $srcTable, $varMap, $conds, $fname, $insertOptions, $selectOptions );

		if ( $ret === false ) {
			throw new DBQueryError( $this, $this->getErrors(), $this->lastErrno(), /*$sql*/ '', $fname );
		} elseif ( $ret != null ) {
			// remember number of rows affected
			$this->mAffectedRows = sqlsrv_rows_affected( $ret );
			return $ret;
		}
		return null;
	}
开发者ID:nahoj,项目名称:mediawiki_ynh,代码行数:29,代码来源:DatabaseMssql.php


注:本文中的DatabaseBase::insertSelect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。