本文整理汇总了PHP中mssql_rows_affected函数的典型用法代码示例。如果您正苦于以下问题:PHP mssql_rows_affected函数的具体用法?PHP mssql_rows_affected怎么用?PHP mssql_rows_affected使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mssql_rows_affected函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: executeQuery
private function executeQuery()
{
$return = false;
if ($this->queryType == 'other') {
if (mssql_query($this->query, $this->link) === true) {
$return = true;
$this->error = mssql_get_last_message();
}
} else {
if ($result = mssql_query($this->query, $this->link)) {
// Conteo de registros
if ($this->queryType == 'insert' || $this->queryType == 'update' || $this->queryType == 'delete') {
$this->numRows = mssql_rows_affected($this->link);
$return = true;
} else {
$this->numRows = mssql_num_rows($result);
$fetchType = MSSQL_NUM;
if ($this->queryReturn == 'assoc') {
$fetchType = MSSQL_ASSOC;
} elseif ($this->queryReturn == 'both') {
$fetchType = MSSQL_BOTH;
}
$return = array();
while ($row = mssql_fetch_array($result, $fetchType)) {
array_push($return, $row);
}
}
$this->error = mssql_get_last_message();
mssql_free_result($result);
} else {
$this->error = mssql_get_last_message();
}
}
return $return;
}
开发者ID:foreverphp,项目名称:framework,代码行数:35,代码来源:MSSQLEngine.php
示例2: count_affected
function count_affected()
{
if (ANEWT_DATABASE_MSSQL_ROWS_AFFECTED_EXISTS) {
return mssql_rows_affected($this->rs);
} else {
return $this->rowcount;
}
}
开发者ID:jijkoun,项目名称:ssscrape,代码行数:8,代码来源:resultset.lib.php
示例3: _doExec
protected function _doExec($query)
{
if (!mssql_select_db($this->profile['database'], $this->_connection)) {
throw new jException('jelix~db.error.database.unknown', $this->profile['database']);
}
if ($qI = mssql_query($query, $this->_connection)) {
return mssql_rows_affected($this->_connection);
} else {
throw new jException('jelix~db.error.query.bad', mssql_get_last_message());
}
}
开发者ID:havefnubb,项目名称:havefnubb,代码行数:11,代码来源:mssql.dbconnection.php
示例4: doQuery
/**
Does the mssql-dependent work of the execute method.
@param $sQuery The query to execute.
@return weeSQLiteResult A result set for SELECT queries.
*/
protected function doQuery($sQuery)
{
// mssql_query triggers a warning when the query could not be executed.
$m = @mssql_query($sQuery, $this->rLink);
$m === false and burn('DatabaseException', sprintf(_WT("Failed to execute the query with the following error:\n%s"), mssql_get_last_message()));
// Get it now since it can be wrong if numAffectedRows is called after getPKId
$this->iNumAffectedRows = mssql_rows_affected($this->rLink);
if ($m !== true) {
return new weeMSSQLResult($m);
}
}
开发者ID:extend,项目名称:wee,代码行数:17,代码来源:weeMSSQLStatement.class.php
示例5: exec
public function exec(&$statement)
{
if ($result = @mssql_query($statement, $this->link)) {
if (is_resource($result)) {
mssql_free_result($result);
return 0;
}
return mssql_rows_affected($this->link);
}
return false;
}
开发者ID:PHPcomaptibility,项目名称:PHPPDO,代码行数:11,代码来源:mssql.php
示例6: execute
public function execute($sql, $bindParams = array(), $additionalParameters = array())
{
$sql = $this->bind($sql, $bindParams);
if ($result = mssql_query($sql, $this->connection)) {
$rows = array();
if (is_resource($result)) {
while ($row = mssql_fetch_assoc($result)) {
$rows[] = $row;
}
mssql_free_result($result);
$this->affectedRows = 0;
} else {
$this->affectedRows = mssql_rows_affected($this->connection);
}
return empty($rows) ? null : $rows;
} else {
$this->executeError($sql);
}
}
开发者ID:reoring,项目名称:sabel,代码行数:19,代码来源:Driver.php
示例7: affected_rows
/**
* Return the number of affected rows
* @return int
*/
protected function affected_rows()
{
return @mssql_rows_affected($this->resConnection);
}
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:8,代码来源:DB_Mssql.php
示例8: affected_rows
public function affected_rows($resource = null)
{
return mssql_rows_affected(is_resource($resource) ? $resouce : $this->getConnection());
}
开发者ID:codegooglecom,项目名称:torpor-php,代码行数:4,代码来源:MSSQLDataStore.php
示例9: _affectedRows
protected function _affectedRows()
{
return mssql_rows_affected($this->connection);
}
开发者ID:romanshuvalov,项目名称:OpenStreetMap.ru,代码行数:4,代码来源:dbFacile_mssql.php
示例10: execute
/**
* (non-PHPdoc)
*
* @see Core_DB::execute()
*/
public function execute($str)
{
$this->parse_query($str);
if (!is_resource($this->link)) {
$this->connect();
}
N('db_write', 1);
G('queryStartTime');
$result = mssql_query($this->query_str, $this->link);
$this->debug();
if (false === $result) {
$this->error();
return false;
} else {
$this->num_rows = mssql_rows_affected($this->link);
$this->lastinsid = $this->mssql_insert_id();
return $this->num_rows;
}
}
开发者ID:hubs,项目名称:yuncms,代码行数:24,代码来源:Mssql.php
示例11: affectedRows
/**
* Return the number of rows affected by the previous operation.
* @return int
*/
public function affectedRows()
{
if ($this->mssql) {
return mssql_rows_affected($this->dbConn);
} else {
return $this->lastAffectedRows;
}
}
开发者ID:natmchugh,项目名称:silverstripe-mssql,代码行数:12,代码来源:MSSQLDatabase.php
示例12: _post_query
function _post_query($query, $dbh)
{
++$this->num_queries;
// If there is an error then take note of it..
if ($this->result == FALSE && ($this->last_error = mssql_get_last_message())) {
$this->log_query($this->last_error);
//var_dump($query);
//var_dump($this->translation_changes);
$this->print_error();
return false;
}
if (defined('SAVEQUERIES') && SAVEQUERIES) {
$this->queries[] = array($query, $this->timer_stop(), $this->get_caller());
}
if (preg_match("/^\\s*(insert|delete|update|replace) /i", $query)) {
$this->rows_affected = mssql_rows_affected($dbh);
// Take note of the insert_id
if (preg_match("/^\\s*(insert|replace) /i", $query)) {
$result = @mssql_fetch_object(@mssql_query("SELECT SCOPE_IDENTITY() AS ID"));
$this->insert_id = $result->ID;
}
$return_val = $this->rows_affected;
} else {
$i = 0;
while ($i < @mssql_num_fields($this->result)) {
$field = @mssql_fetch_field($this->result, $i);
$new_field = new stdClass();
$new_field->name = $field->name;
$new_field->table = $field->column_source;
$new_field->def = null;
$new_field->max_length = $field->max_length;
$new_field->not_null = true;
$new_field->primary_key = null;
$new_field->unique_key = null;
$new_field->multiple_key = null;
$new_field->numeric = $field->numeric;
$new_field->blob = null;
$new_field->type = $field->type;
if (isset($field->unsigned)) {
$new_field->unsigned = $field->unsigned;
} else {
$new_field->unsigned = null;
}
$new_field->zerofill = null;
$this->col_info[$i] = $new_field;
$i++;
}
$num_rows = 0;
while ($row = @mssql_fetch_object($this->result)) {
$this->last_result[$num_rows] = $row;
$num_rows++;
}
$this->last_result = $this->fix_results($this->last_result);
// perform limit
if (!empty($this->limit)) {
$this->last_result = array_slice($this->last_result, $this->limit['from'], $this->limit['to']);
$num_rows = count($this->last_result);
}
@mssql_free_result($this->result);
// Log number of rows the query returned
$this->num_rows = $num_rows;
// Return number of rows selected
$return_val = $this->num_rows;
}
$this->log_query();
return $return_val;
}
开发者ID:developmentDM2,项目名称:Whohaha,代码行数:67,代码来源:mssql.php
示例13: update_entity
/**
* 更新数据
* @param string $table 表名
* @param mixed $condition 要更新的where条件或者字符下标的条件数组
* @param array $data 要更新的数据,字符下标的数组形式
* @param array $pam 数字下标的数组,数组项依次替换$condition中的"?"参数
* @return integer 成功返回受影响的行数,更新失败返回null
*/
function update_entity($table, $condition = null, $data = array(), $pam = null)
{
$ssql = "update [{$table}] set ";
$vars = array();
$vals = array();
$columns = $this->list_fields($table);
foreach ($data as $k => $val) {
if (in_array($k, $columns)) {
$vars[] = "[{$k}]=@yYUc_SqL@ ";
$vals[] = $val === null ? self::raw('null') : $val;
}
}
$ssql .= implode(",", $vars);
if (!empty($condition)) {
if (is_string($condition)) {
$condition = str_replace('?', '@yYUc_SqL@', $condition);
}
$whereres = $this->con_sql($condition, $pam);
$ssql .= trim($whereres[0]);
$pam = $whereres[1];
if ($pam !== null) {
$vals = array_merge($vals, $pam);
}
}
if ($this->execute($ssql, $vals)) {
return mssql_rows_affected($this->conn);
}
return null;
}
开发者ID:codingoneapp,项目名称:codingone,代码行数:37,代码来源:db.php
示例14: affectedRows
public function affectedRows()
{
return mssql_rows_affected($this->linkID);
}
开发者ID:ChrisWesterfield,项目名称:MJR.ONE-CP,代码行数:4,代码来源:Mssql.php
示例15: getAffectedRowCount
function getAffectedRowCount()
{
return mssql_rows_affected($this->connection->getConnectionId());
}
开发者ID:snowjobgit,项目名称:limb,代码行数:4,代码来源:lmbMssqlManipulationStatement.class.php
示例16: _affectedRows
/**
* Returns the number of rows affected
*
* @param resource $result
* @param resource $connection
* @return mixed MDB2 Error Object or the number of rows affected
* @access private
*/
function _affectedRows($connection, $result = null)
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
return $connection;
}
}
return @mssql_rows_affected($connection);
}
开发者ID:ajisantoso,项目名称:kateglo,代码行数:18,代码来源:mssql.php
示例17: myfetchAll
private function myfetchAll($result)
{
if (mssql_rows_affected($this->myconnection) == -1) {
return false;
}
if (!is_resource($result)) {
return false;
} else {
while ($rows[] = mssql_fetch_array($result, MYSQL_ASSOC)) {
}
array_pop($rows);
return $rows;
}
}
开发者ID:nerfqxx,项目名称:wowqxweb,代码行数:14,代码来源:sms.class.php
示例18: DbAffectedRows
function DbAffectedRows()
{
return @mssql_rows_affected($this->ConnectionID);
}
开发者ID:Arnaud69,项目名称:phpmynewsletter-2.0,代码行数:4,代码来源:db_mssql.inc.php
示例19: executeUpdate
/**
* @see Connection::executeUpdate()
*/
function executeUpdate($sql)
{
$this->lastQuery = $sql;
if (!mssql_select_db($this->database, $this->dblink)) {
throw new SQLException('No database selected');
}
$result = @mssql_query($sql, $this->dblink);
if (!$result) {
throw new SQLException('Could not execute update', mssql_get_last_message(), $sql);
}
return (int) mssql_rows_affected($this->dblink);
// return $this->getUpdateCount();
}
开发者ID:bqevin,项目名称:processmaker,代码行数:16,代码来源:MSSQLConnection.php
示例20: NonQuery
/**
* @param unknown $query
* @param unknown $connection
* @return boolean|number
*/
public function NonQuery($query)
{
$result = null;
try {
switch ($this->type) {
case TSP_Settings::$database_mysql:
case TSP_Settings::$database_mysqli:
mysqli_query(self::$connection, $query);
$result = mysqli_affected_rows(self::$connection);
break;
case TSP_Settings::$database_mssql:
mssql_query($query, self::$connection);
$result = mssql_rows_affected(self::$connection);
break;
default:
break;
}
if ($result == -1) {
return false;
}
return $result;
} catch (Exception $e) {
throw new Exception("Error Occurred in " . __FUNCTION__ . ": " . $e->getMessage() . PHP_EOL);
}
}
开发者ID:thesoftwarepeople,项目名称:helpers,代码行数:30,代码来源:Database.php
注:本文中的mssql_rows_affected函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论