本文整理汇总了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;
}
示例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;
}
示例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;
}